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
318 stars 58 forks source link

[BUG] Admin panel breaks after resetting settings to the plugin configuration #428

Open SalahAdDin opened 6 months ago

SalahAdDin commented 6 months ago

Just for testing, we decided to restart the navigation settings to the plugin configuration: image After restarting the panel we just update the configuration and we go to the content type building section, it breaks:

Object { err: {…} }
​
err: Object { stack: "ln@http://localhost:1337/admin/main.cce85147.js:7559:59910\n41629/Gr.xhr</</gi.onerror@http://localhost:1337/admin/main.cce85147.js:7561:5070\nEventHandlerNonNull*41629/Gr.xhr</<@http://localhost:1337/admin/main.cce85147.js:7561:5045\n41629/Gr.xhr<@http://localhost:1337/admin/main.cce85147.js:7561:3628\nYt@http://localhost:1337/admin/main.cce85147.js:7563:531\npromise callback*request@http://localhost:1337/admin/main.cce85147.js:7563:4336\n41629/</An.prototype[ot]@http://localhost:1337/admin/main.cce85147.js:7563:4831\n41629/t/<@http://localhost:1337/admin/main.cce85147.js:7559:54297\nget@http://localhost:1337/admin/main.cce85147.js:7051:2527\n@http://localhost:1337/admin/200.c25ebb10.chunk.js:154:34643\n30200/wr/J.current@http://localhost:1337/admin/200.c25ebb10.chunk.js:154:34632\n30200/wr/<@http://localhost:1337/admin/200.c25ebb10.chunk.js:154:34875\nPi@http://localhost:1337/admin/main.cce85147.js:2770:25610\nvf@http://localhost:1337/admin/main.cce85147.js:2770:44721\ncp@http://localhost:1337/admin/main.cce85147.js:2770:43454\nef@http://localhost:1337/admin/main.cce85147.js:2770:42450\nxp@http://localhost:1337/admin/main.cce85147.js:2770:38881\nQl@http://localhost:1337/admin/main.cce85147.js:2768:3353\n36891/Sc/<@http://localhost:1337/admin/main.cce85147.js:2770:36136\nVoidFunction*Sc@http://localhost:1337/admin/main.cce85147.js:2770:36113\nUd@http://localhost:1337/admin/main.cce85147.js:2770:35793\nff@http://localhost:1337/admin/main.cce85147.js:2768:23844\n13532/Jv/</<@http://localhost:1337/admin/main.cce85147.js:3299:2144\nasync*13532/Jv/<@http://localhost:1337/admin/main.cce85147.js:3299:2170\nPi@http://localhost:1337/admin/main.cce85147.js:2770:25610\nvf@http://localhost:1337/admin/main.cce85147.js:2770:44721\ncp@http://localhost:1337/admin/main.cce85147.js:2770:43454\nef@http://localhost:1337/admin/main.cce85147.js:2770:42450\nxp@http://localhost:1337/admin/main.cce85147.js:2770:38881\nQl@http://localhost:1337/admin/main.cce85147.js:2768:3353\n36891/Sc/<@http://localhost:1337/admin/main.cce85147.js:2770:36136\nVoidFunction*Sc@http://localhost:1337/admin/main.cce85147.js:2770:36113\n", message: "Network Error", name: "AxiosError", … }
​​
code: "ERR_NETWORK"
​​
config: Object { timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", … }
​​
message: "Network Error"
​​
name: "AxiosError"
​​
request: XMLHttpRequest { readyState: 4, timeout: 0, withCredentials: false, … }
​​
stack: "ln@http://localhost:1337/admin/main.cce85147.js:7559:59910\n41629/Gr.xhr</</gi.onerror@http://localhost:1337/admin/main.cce85147.js:7561:5070\nEventHandlerNonNull*41629/Gr.xhr</<@http://localhost:1337/admin/main.cce85147.js:7561:5045\n41629/Gr.xhr<@http://localhost:1337/admin/main.cce85147.js:7561:3628\nYt@http://localhost:1337/admin/main.cce85147.js:7563:531\npromise callback*request@http://localhost:1337/admin/main.cce85147.js:7563:4336\n41629/</An.prototype[ot]@http://localhost:1337/admin/main.cce85147.js:7563:4831\n41629/t/<@http://localhost:1337/admin/main.cce85147.js:7559:54297\nget@http://localhost:1337/admin/main.cce85147.js:7051:2527\n@http://localhost:1337/admin/200.c25ebb10.chunk.js:154:34643\n30200/wr/J.current@http://localhost:1337/admin/200.c25ebb10.chunk.js:154:34632\n30200/wr/<@http://localhost:1337/admin/200.c25ebb10.chunk.js:154:34875\nPi@http://localhost:1337/admin/main.cce85147.js:2770:25610\nvf@http://localhost:1337/admin/main.cce85147.js:2770:44721\ncp@http://localhost:1337/admin/main.cce85147.js:2770:43454\nef@http://localhost:1337/admin/main.cce85147.js:2770:42450\nxp@http://localhost:1337/admin/main.cce85147.js:2770:38881\nQl@http://localhost:1337/admin/main.cce85147.js:2768:3353\n36891/Sc/<@http://localhost:1337/admin/main.cce85147.js:2770:36136\nVoidFunction*Sc@http://localhost:1337/admin/main.cce85147.js:2770:36113\nUd@http://localhost:1337/admin/main.cce85147.js:2770:35793\nff@http://localhost:1337/admin/main.cce85147.js:2768:23844\n13532/Jv/</<@http://localhost:1337/admin/main.cce85147.js:3299:2144\nasync*13532/Jv/<@http://localhost:1337/admin/main.cce85147.js:3299:2170\nPi@http://localhost:1337/admin/main.cce85147.js:2770:25610\nvf@http://localhost:1337/admin/main.cce85147.js:2770:44721\ncp@http://localhost:1337/admin/main.cce85147.js:2770:43454\nef@http://localhost:1337/admin/main.cce85147.js:2770:42450\nxp@http://localhost:1337/admin/main.cce85147.js:2770:38881\nQl@http://localhost:1337/admin/main.cce85147.js:2768:3353\n36891/Sc/<@http://localhost:1337/admin/main.cce85147.js:2770:36136\nVoidFunction*Sc@http://localhost:1337/admin/main.cce85147.js:2770:36113\n"
​​
<prototype>: Object { constructor: ln(He, ot, Tt, sn, or), toJSON: toJSON(), stack: "", … }
​
<prototype>: Object { … }
seo:12714:25
    overrideMethod http://localhost:1337/admin/plugins/seo:12714
    current http://localhost:1337/admin/200.c25ebb10.chunk.js:154
    wr http://localhost:1337/admin/200.c25ebb10.chunk.js:154
    Pi http://localhost:1337/admin/main.cce85147.js:2770
    vf http://localhost:1337/admin/main.cce85147.js:2770
    cp http://localhost:1337/admin/main.cce85147.js:2770
    ef http://localhost:1337/admin/main.cce85147.js:2770
    xp http://localhost:1337/admin/main.cce85147.js:2770
    Ql http://localhost:1337/admin/main.cce85147.js:2768
    Sc http://localhost:1337/admin/main.cce85147.js:2770
    (Async: VoidFunction)
    Sc http://localhost:1337/admin/main.cce85147.js:2770
    Ud http://localhost:1337/admin/main.cce85147.js:2770
    ff http://localhost:1337/admin/main.cce85147.js:2768
    Jv http://localhost:1337/admin/main.cce85147.js:3299
    Jv http://localhost:1337/admin/main.cce85147.js:3299
    Pi http://localhost:1337/admin/main.cce85147.js:2770
    vf http://localhost:1337/admin/main.cce85147.js:2770
    cp http://localhost:1337/admin/main.cce85147.js:2770
    ef http://localhost:1337/admin/main.cce85147.js:2770
    xp http://localhost:1337/admin/main.cce85147.js:2770
    Ql http://localhost:1337/admin/main.cce85147.js:2768
    Sc http://localhost:1337/admin/main.cce85147.js:2770
    (Async: VoidFunction)
    Sc http://localhost:1337/admin/main.cce85147.js:2770
    Ud http://localhost:1337/admin/main.cce85147.js:2770
    enqueueSetState http://localhost:1337/admin/main.cce85147.js:2768
    setState http://localhost:1337/admin/main.cce85147.js:2843
    unlisten http://localhost:1337/admin/main.cce85147.js:2824
    xn http://localhost:1337/admin/main.cce85147.js:2645
    Ht http://localhost:1337/admin/main.cce85147.js:2645
    Ht http://localhost:1337/admin/main.cce85147.js:2645
    Mt http://localhost:1337/admin/main.cce85147.js:2645
    gn http://localhost:1337/admin/main.cce85147.js:2645
    lt http://localhost:1337/admin/main.cce85147.js:2645
    gn http://localhost:1337/admin/main.cce85147.js:2645
    navigate http://localhost:1337/admin/main.cce85147.js:2824
    onClick http://localhost:1337/admin/main.cce85147.js:2824
    un http://localhost:1337/admin/main.cce85147.js:2767
    xe http://localhost:1337/admin/main.cce85147.js:2767
    Pe http://localhost:1337/admin/main.cce85147.js:2767
    so http://localhost:1337/admin/main.cce85147.js:2767
    Al http://localhost:1337/admin/main.cce85147.js:2767
    Dl http://localhost:1337/admin/main.cce85147.js:2767
    mh http://localhost:1337/admin/main.cce85147.js:2770
    tr http://localhost:1337/admin/main.cce85147.js:2767
    Dl http://localhost:1337/admin/main.cce85147.js:2767
    Wo http://localhost:1337/admin/main.cce85147.js:2767
    Xa http://localhost:1337/admin/main.cce85147.js:2767
    (Async: EventListener.handleEvent)
    qo http://localhost:1337/admin/main.cce85147.js:2767
    Ku http://localhost:1337/admin/main.cce85147.js:2767
    La http://localhost:1337/admin/main.cce85147.js:2767
    La http://localhost:1337/admin/main.cce85147.js:2767
    createRoot http://localhost:1337/admin/main.cce85147.js:2770
    d2 http://localhost:1337/admin/main.cce85147.js:4617
    Me http://localhost:1337/admin/main.cce85147.js:1154
    98071 http://localhost:1337/admin/main.cce85147.js:1154
    f http://localhost:1337/admin/runtime~main.bca9e15c.js:1
    c http://localhost:1337/admin/main.cce85147.js:7563
    <anonymous> http://localhost:1337/admin/main.cce85147.js:7563
    t http://localhost:1337/admin/runtime~main.bca9e15c.js:2
    <anonymous> http://localhost:1337/admin/main.cce85147.js:1

It seems to not be compatible with Strapi SEO plugin, which is a big issue since SEO is a very required plugin for landing and corporate websites and the plugin is official.

Why?

Launched In: 1668 ms Environment: development OS: linux-x64 Strapi Version: 4.24.1 Node/Yarn Version: yarn/4.1.1 npm/? node/v20.12.2 linux x64 Edition: Community Database: sqlite

cyp3rius commented 5 months ago

We will check that, although the Reset functionality just read data from config file and save instead of takin from UI + restart is a "native" Strapi functionality. Plugin can't impact the other plugins and for me it looks like issue with "restart" of Strapi more.

CodeVoyager commented 5 months ago

Hi @SalahAdDin

I tried to reproduce the issue. I reset the config, restarted server, made a small change in the config and then restarted again. After all of that I displayed content type builder. I had no issues beside picking a built-in content type that hadn't any GraphQL definitions so server was not able to start up. (SEO plugin was also installed for my server)

Beside that, no issues. Plugin itself does not use core functionalities in any advanced way, just storing the config, querying for saved navigations and navigation items, querying for related content types.

I'm not sure what SEO does internally (some details cacheing?) or what your config is, or what your content types are. If you can share some more info or debug on your instance that will be helpful. For now, I'm not sure if we can help you in your need.

SalahAdDin commented 2 months ago

Hi @SalahAdDin

I tried to reproduce the issue. I reset the config, restarted server, made a small change in the config and then restarted again. After all of that I displayed content type builder. I had no issues beside picking a built-in content type that hadn't any GraphQL definitions so server was not able to start up. (SEO plugin was also installed for my server)

Beside that, no issues. Plugin itself does not use core functionalities in any advanced way, just storing the config, querying for saved navigations and navigation items, querying for related content types.

I'm not sure what SEO does internally (some details cacheing?) or what your config is, or what your content types are. If you can share some more info or debug on your instance that will be helpful. For now, I'm not sure if we can help you in your need.

@CodeVoyager What kind of debug do you need? Can you guide me?