Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The module is not working with Nuxt 3.12 #52

Closed
Applelo opened this issue Jun 11, 2024 · 2 comments
Closed

The module is not working with Nuxt 3.12 #52

Applelo opened this issue Jun 11, 2024 · 2 comments

Comments

@Applelo
Copy link
Contributor

Applelo commented Jun 11, 2024

Hi, I have upgraded my project to Nuxt 3.12 and I have encounter an issue with Nuxt Multi cache.

 ERROR  [worker reload] [worker init] Cannot read properties of undefined (reading 'component')          2:09:40 PM

  at <anonymous> (node_modules/.pnpm/nuxt-multi-cache@3.1.1_patch_hash=3d7jtreyhnmo6h3yjzuqi7daoa_rollup@4.18.0/node_modules/nuxt-multi-cache/dist/runtime/serverHandler/helpers/storage.mjs:7:30)
  at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
  at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
  at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

The plugin didn't success to load the nuxt.config.ts configuration on server side.

I think there is a change in how you can get runtimeConfig through Nitro. The module currently load the global runtimeConfig and the multiCache config doesn't exist :

const runtimeConfig = useRuntimeConfig();

On the Nitro documentation, it is recommended to load the event inside the useRuntimeConfig, see https://nitro.unjs.io/guide/configuration#runtime-configuration.

[EDIT] Maybe use check to use something like this : harlan-zw/nuxt-schema-org#55

@Applelo Applelo changed the title The module not working anymore with Nuxt 3.12 The module is not working with Nuxt 3.12 Jun 11, 2024
@Applelo
Copy link
Contributor Author

Applelo commented Jun 13, 2024

I have make a reproduction and the error doesn't happen. Seems like this is an issue cause by some code rewriting runtimeConfig on my side or on an other module 🤔 .

@Applelo Applelo closed this as completed Jun 13, 2024
@Applelo
Copy link
Contributor Author

Applelo commented Jun 13, 2024

So after investigation, it seems Nuxt Turnstile is creating this bug in combination with nuxt-graphql-middleware. I have move nuxt turnstile in nuxt config modules at the end and it is not throwing the error anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant