VirtusLab-Open-Source / strapi-plugin-navigation

A plugin for Strapi Headless CMS that provides navigation / menu builder feature with their possibility to control the audience and different output structure renderers like (flat, tree and RFR - ready for handling by Redux First Router)
MIT License
314 stars 58 forks source link

After upgrade to Strapi v4.5.4: "Uncaught TypeError: g.indexOf is not a function" #295

Closed maxbraeutigam closed 1 year ago

maxbraeutigam commented 1 year ago

Hello, after upgrade to Strapi v4.5.4 I realised a strange bug on the client side when opening the navigation plugin.

Steps to reproduce

0 Start on dashboard

http://localhost:1337/admin/ image

1 Go to Content Manager

http://localhost:1337/admin/content-manager/ image

2 Go to Navigation Plugin

http://localhost:1337/admin/plugins/navigation image

3 Create an entry

image

4 On click on Content Type the error occurs

image

Further notes

Step 1 is important to reproduce the error. I can perfectly use the navigation plugin, if I am entering the plugins side directly or refresh the page. Unfortunately, I have no idea of how to further debug the error.

Config

My package.json

{
  "name": "cms",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "devDependencies": {},
  "dependencies": {
    "@_sh/strapi-plugin-ckeditor": "^1.1.2",
    "@strapi/plugin-graphql": "^4.5.4",
    "@strapi/plugin-i18n": "^4.5.4",
    "@strapi/plugin-users-permissions": "^4.5.4",
    "@strapi/provider-email-nodemailer": "^4.5.4",
    "@strapi/provider-upload-aws-s3": "^4.5.4",
    "@strapi/strapi": "^4.5.4",
    "better-sqlite3": "^8.0.1",
    "pg": "^8.8.0",
    "pg-connection-string": "^2.5.0",
    "strapi-plugin-navigation": "^2.2.2",
    "strapi-plugin-publisher": "^1.1.4"
  },
  "author": {
    "name": "A Strapi developer"
  },
  "strapi": {
    "uuid": "3bc2bb22-bb12-4e14-90c5-5ce6b886dbc2"
  },
  "engines": {
    "node": ">=14.19.1 <=18.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT"
}

Starting dev

nvm use lts/gallium
yarn install
yarn build
yarn develop
cyp3rius commented 1 year ago

Thanks for reporting @maxbraeutigam , we will take a look on this edge case.

maxbraeutigam commented 1 year ago

Hi @cyp3rius – I have to apologize for filing this issue since I was able to fix it and—tada—it was my fault. I solved the problem by moving towards fixed versions in package.json (see below) and deleting yarn.lock (basically following the Strapi upgrade guide).

Again, I am sorry. Thank you very much for this brilliant plugin, that makes Strapi unique.

Cheers, Max

diff --git a/package.json b/package.json
index b38877f..111442a 100644
--- a/package.json
+++ b/package.json
@@ -12,12 +12,12 @@
   "devDependencies": {},
   "dependencies": {
     "@_sh/strapi-plugin-ckeditor": "^1.1.2",
-    "@strapi/plugin-graphql": "^4.5.4",
-    "@strapi/plugin-i18n": "^4.5.4",
-    "@strapi/plugin-users-permissions": "^4.5.4",
-    "@strapi/provider-email-nodemailer": "^4.5.4",
-    "@strapi/provider-upload-aws-s3": "^4.5.4",
-    "@strapi/strapi": "^4.5.4",
+    "@strapi/plugin-graphql": "4.5.4",
+    "@strapi/plugin-i18n": "4.5.4",
+    "@strapi/plugin-users-permissions": "4.5.4",
+    "@strapi/provider-email-nodemailer": "4.5.4",
+    "@strapi/provider-upload-aws-s3": "4.5.4",
+    "@strapi/strapi": "4.5.4",
     "better-sqlite3": "^8.0.1",
     "pg": "^8.8.0",
     "pg-connection-string": "^2.5.0",