Skip to content

Failing to migrate from druxt-site 0.10.4 to latest version #688

@S4toruu

Description

@S4toruu

Describe the bug
We're trying to migrate from druxt-site 0.10.4 to the latest version. When the update is applied, the website becomes 10 times slower than usual and sometimes doesn't even load. After looking at the HTTP server logs, I realised that there's a lot similar requests happening:

/jsonapi HTTP/1.1" 200 15314
/en/jsonapi/jsonapi_resource_config/jsonapi_resource_config HTTP/1.1" 200 232
/en/jsonapi HTTP/1.1" 200 15314

These requests happen at build time using "nuxt dev" but also when trying to load a simple node. (See attached screenshots below)

We also end up having timeout on production like environment:

NuxtICA >  WARN  503: Loop detected
NuxtICA > URL: https://backendmrs.quadient.com/fr-ch/jsonapi/jsonapi_resource_config/jsonapi_resource_config

I'm wondering if the following piece of code might be causing all of this:

getIndex from druxt.ssr.js / druxt.esm.js

 if ((this.index || {})[prefix] && !resource) {
   return this.index[prefix];
 }
 if ((this.index || {})[prefix] && resource) {
   return this.index[prefix][resource] ? this.index[prefix][resource] : false;
 }

To Reproduce
Steps to reproduce the behavior:

  1. Uninstall druxt-site:^0.10.4
  2. Install latest druxt-site version
  3. Run "npm run dev" or "nuxt dev"
  4. Have a look at the logs

Expected behavior
Frontend to work as expected

Media
Screenshot_2023-11-16_at_09 43 03
Screenshot-2023-11-16-at-09 31 42
)

Your Environment (please complete the following information):
Backend:

  • Docksal (Docker based)
  • Drupal core 10.1.5
  • DruxtJS 1.2.0
  • Decoupled Router 2.0.4
  • Multilingual (we have several languages installed)
  • Layout paragaphs + paragraphs modules

Frontend:

  • Nuxt @ v2.16.3
  • Druxt @ v0.22.0 (Previous version: Druxt @ v0.16.0)
  • druxt-site 0.14.2 (Previous version: druxt-site 0.10.4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions