VirtusLab-Open-Source/strapi-plugin-comments

error with strapi 4.7.1

jhackr opened this issue ยท 8 comments

if you have a new version of strapi and install comment you will got a blank page with role
/admin/settings/users-permissions/roles
if delete plugin then you can access to that page.
hope you gonna fix it soon

Thanks for reporting @jhackr . May I ask you to provide details like:

  • node version
  • comments plugin version
  • console error stack trace

It will be easier to investigate.

Just tested it on 4.7.1 and works as expected.

Screenshot 2023-03-03 at 08 46 09

Please provide more details, mentioned above + dependencies from package.json

If Strapi is running, you're able to use it but some of the internal stuff does not work because of as you said installing our plugin that might not be the case of plugin itself but some of your other customizations, in here roles maybe? Comments plugin uses Roles as a dependency not the opposite.

Fresh install, no additional roles added. Works.

I just tested today it work as well on strapi 4.6.1.
But when upgrade to 4.7.1 the role dosen't work.
I just update strapi now again.
Capture

my package.json
{ "name": "", "private": true, "version": "0.1.0", "description": "A Strapi application", "scripts": { "develop": "strapi develop", "start": "strapi start", "build": "strapi build", "strapi": "strapi" }, "dependencies": { "@ckeditor/strapi-plugin-ckeditor": "^0.0.7", "@strapi/plugin-i18n": "4.7.1", "@strapi/plugin-users-permissions": "4.7.1", "@strapi/strapi": "4.7.1", "mysql": "2.18.1", "strapi-plugin-comments": "^2.2.6" }, "author": { "name": "A Strapi developer" }, "strapi": { "uuid": "" }, "engines": { "node": ">=14.19.1 <=18.x.x", "npm": ">=6.0.0" }, "license": "MIT" }

node -v v18.14.0
yarn -v 1.22.19
strapi 4.7.1 typescript
mysql db
ubunto 22

I didn't make a fresh install I just upgrade and migrate from strapi 4.6.1 to 4.7.1
I follow https://docs.strapi.io/dev-docs/migration/v4/migration-guide-4.6.1-to-4.7.0

additional info
If I delete comment plugin on strapi 4.7.1 role path will work.

Thanks for all the details @jhackr , I'm trying to reproduce it then based on flow you described.

Additionally as I'm seeing server console healthy can you provide the browser console stack of this white page?

sure @cyp3rius

Capture

`
TypeError: k.default is not a function
W https://api..../admin/users-roles-settings-page.aface2ad.chunk.js:1
sc https://api..../admin/main.fe744e8d.js:1638
Bc https://api..../admin/main.fe744e8d.js:1642
wa https://api..../admin/main.fe744e8d.js:1642
uo https://api..../admin/main.fe744e8d.js:1642
Es https://api..../admin/main.fe744e8d.js:1642
Ka https://api..../admin/main.fe744e8d.js:1640
vl https://api..../admin/main.fe744e8d.js:1638
unstable_runWithPriority https://api..../admin/main.fe744e8d.js:1682
ds https://api..../admin/main.fe744e8d.js:1638
vl https://api..../admin/main.fe744e8d.js:1638
To https://api..../admin/main.fe744e8d.js:1638
ni https://api..../admin/main.fe744e8d.js:1640
Zu https://api..../admin/main.fe744e8d.js:1638
on https://api..../admin/main.fe744e8d.js:34
on https://api..../admin/main.fe744e8d.js:34
Wc https://api..../admin/main.fe744e8d.js:1642
unstable_runWithPriority https://api..../admin/main.fe744e8d.js:1682
ds https://api..../admin/main.fe744e8d.js:1638
ma https://api..../admin/main.fe744e8d.js:1642
nu https://api..../admin/main.fe744e8d.js:1642
z https://api..../admin/main.fe744e8d.js:1682
onmessage https://api..../admin/main.fe744e8d.js:1682
60053 https://api..../admin/main.fe744e8d.js:1682
e https://api..../admin/runtime~main.959765c1.js:1
63840 https://api..../admin/main.fe744e8d.js:1682
e https://api..../admin/runtime~main.959765c1.js:1
64448 https://api..../admin/main.fe744e8d.js:1634
e https://api..../admin/runtime~main.959765c1.js:1
73935 https://api..../admin/main.fe744e8d.js:1642
e https://api..../admin/runtime~main.959765c1.js:1
17025 https://api..../admin/main.fe744e8d.js:519
e https://api..../admin/runtime~main.959765c1.js:1
n https://api..../admin/main.fe744e8d.js:5637
https://api..../admin/main.fe744e8d.js:5637
r https://api..../admin/runtime~main.959765c1.js:2
https://api..../admin/main.fe744e8d.js:1
main.fe744e8d.js:1640:75
Xl https://api..../admin/main.fe744e8d.js:1640
callback https://api..../admin/main.fe744e8d.js:1640
bo https://api..../admin/main.fe744e8d.js:1638
Qi https://api..../admin/main.fe744e8d.js:1640
tu https://api..../admin/main.fe744e8d.js:1642
unstable_runWithPriority https://api..../admin/main.fe744e8d.js:1682
ds https://api..../admin/main.fe744e8d.js:1638
Do https://api..../admin/main.fe744e8d.js:1642
Ka https://api..../admin/main.fe744e8d.js:1640
vl https://api..../admin/main.fe744e8d.js:1638
unstable_runWithPriority https://api..../admin/main.fe744e8d.js:1682
ds https://api..../admin/main.fe744e8d.js:1638
vl https://api..../admin/main.fe744e8d.js:1638
To https://api..../admin/main.fe744e8d.js:1638
ni https://api..../admin/main.fe744e8d.js:1640
Zu https://api..../admin/main.fe744e8d.js:1638
on https://api..../admin/main.fe744e8d.js:34
on https://api..../admin/main.fe744e8d.js:34
Wc https://api..../admin/main.fe744e8d.js:1642
unstable_runWithPriority https://api..../admin/main.fe744e8d.js:1682
ds https://api..../admin/main.fe744e8d.js:1638
ma https://api..../admin/main.fe744e8d.js:1642
nu https://api..../admin/main.fe744e8d.js:1642
z https://api..../admin/main.fe744e8d.js:1682
onmessage https://api..../admin/main.fe744e8d.js:1682
(Async: EventHandlerNonNull)
60053 https://api..../admin/main.fe744e8d.js:1682
e https://api..../admin/runtime~main.959765c1.js:1
63840 https://api..../admin/main.fe744e8d.js:1682
e https://api..../admin/runtime~main.959765c1.js:1
64448 https://api..../admin/main.fe744e8d.js:1634
e https://api..../admin/runtime~main.959765c1.js:1
73935 https://api..../admin/main.fe744e8d.js:1642
e https://api..../admin/runtime~main.959765c1.js:1
17025 https://api..../admin/main.fe744e8d.js:519
e https://api..../admin/runtime~main.959765c1.js:1
n https://api..../admin/main.fe744e8d.js:5637
https://api..../admin/main.fe744e8d.js:5637
r https://api..../admin/runtime~main.959765c1.js:2
https://api..../admin/main.fe744e8d.js:1
TypeError: k.default is not a function
W https://api..../admin/users-roles-settings-page.aface2ad.chunk.js:1
sc https://api..../admin/main.fe744e8d.js:1638
Bc https://api..../admin/main.fe744e8d.js:1642
wa https://api..../admin/main.fe744e8d.js:1642
uo https://api..../admin/main.fe744e8d.js:1642
Es https://api..../admin/main.fe744e8d.js:1642
Ka https://api..../admin/main.fe744e8d.js:1640
vl https://api..../admin/main.fe744e8d.js:1638
unstable_runWithPriority https://api..../admin/main.fe744e8d.js:1682
ds https://api..../admin/main.fe744e8d.js:1638
vl https://api..../admin/main.fe744e8d.js:1638
To https://api..../admin/main.fe744e8d.js:1638
ni https://api..../admin/main.fe744e8d.js:1640
Zu https://api..../admin/main.fe744e8d.js:1638
on https://api..../admin/main.fe744e8d.js:34
on https://api..../admin/main.fe744e8d.js:34
Wc https://api..../admin/main.fe744e8d.js:1642
unstable_runWithPriority https://api..../admin/main.fe744e8d.js:1682
ds https://api..../admin/main.fe744e8d.js:1638
ma https://api..../admin/main.fe744e8d.js:1642
nu https://api..../admin/main.fe744e8d.js:1642
z https://api..../admin/main.fe744e8d.js:1682
onmessage https://api..../admin/main.fe744e8d.js:1682
60053 https://api..../admin/main.fe744e8d.js:1682
e https://api..../admin/runtime~main.959765c1.js:1
63840 https://api..../admin/main.fe744e8d.js:1682
e https://api..../admin/runtime~main.959765c1.js:1
64448 https://api..../admin/main.fe744e8d.js:1634
e https://api..../admin/runtime~main.959765c1.js:1
73935 https://api..../admin/main.fe744e8d.js:1642
e https://api..../admin/runtime~main.959765c1.js:1
17025 https://api..../admin/main.fe744e8d.js:519
e https://api..../admin/runtime~main.959765c1.js:1
n https://api..../admin/main.fe744e8d.js:5637
https://api..../admin/main.fe744e8d.js:5637
r https://api..../admin/runtime~main.959765c1.js:2
https://api..../admin/main.fe744e8d.js:1
main.fe744e8d.js:34:656

`

Possibly bug found in Strapi itself.

The User Permissions uses match-sorter: ^4.0.2 and with updating Strapi it gets version 6.x where are significant changes how the versions are imported. If you check your node_modules you'll see that you probably use 6.x which requires to by imported like:

import {matchSorter} from 'match-sorter'

but in UserPermissions plugin it is imported as:

import matchSorter from 'match-sorter'

That causes errors, I'm about to post issue on strapi/strapi.

@jhackr I've spent a bit more time on investigation. Indeed my founding was correct. I've solved it by forcing the same match-sorter version as in User Permission plugin. Intermediate issue was caused by react-query dependency which requires match-sorter: ^6.0.2.

Hopefully it will work for your config. Version with fix is v2.2.8. I've tested it with different configurations and run types.