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

Nuxt Module is not compatible with compatibilityVersion: 4 #1544

Closed
ralacerda opened this issue Jun 11, 2024 · 3 comments
Closed

Nuxt Module is not compatible with compatibilityVersion: 4 #1544

ralacerda opened this issue Jun 11, 2024 · 3 comments

Comments

@ralacerda
Copy link
Contributor

Reproduction

https://stackblitz.com/edit/nuxt-starter-fr4fai?file=nuxt.config.ts

Steps to reproduce the bug

Install the Nuxt Module in a new project using Nuxt 3.12, and set the future.compatibilityVersion to 4.

Expected behavior

The plugin should work normally

Actual behavior

The following issue is shown on the terminal:

[1:12:59 PM]  WARN  Failed to parse static properties from plugin .nuxt/vuefire-plugin.mjs. Transform failed with 1 error:
<stdin>:12:3: ERROR: Unexpected "%"

  <stdin>:12:3: ERROR: Unexpected "%"
  at failureErrorWithLog (node_modules/esbuild/lib/main.js:1462:15)
  at eval (node_modules/esbuild/lib/main.js:745:50)
  at responseCallbacks.<computed> (node_modules/esbuild/lib/main.js:612:9)
  at handleIncomingPacket (node_modules/esbuild/lib/main.js:667:12)
  at Socket.readFromStdout (node_modules/esbuild/lib/main.js:590:7)
  at Socket.emit (node:events:30:10899)
  at addChunk (node:internal/streams/readable:225:3685)
  at readableAddChunk (node:internal/streams/readable:225:3393)
  at Readable.push (node:internal/streams/readable:225:4971)
  at _0x47a056.onStreamRead (node:internal/stream_base_commons:211:2596)

Additional information

I guess this is a heads up that the module is not yet compatible with Nuxt 4. I would debug it further, but I'm not sure how.
Let me know if there is a way I can help with the issue

@posva
Copy link
Member

posva commented Jun 11, 2024

I think it’s because of the template. They change but I don’t remember how. Feel free to look further and even submit a PR!

@ralacerda
Copy link
Contributor Author

Looks like this is related to nuxt removing compileTemplate.

Daniel Roe already made an PR to fix it: #1525, which I tested locally and I can confirm it works now.

I got an 500 error about @posva/lru-cache which I fixed by explicitly installing it, which I believe came from pnpm not installing the package when installing nuxt-vuefire locally.

@santiagoaloi
Copy link

santiagoaloi commented Jul 2, 2024

@ralacerda

You can apply a workaround:

  experimental: {
    compileTemplate: true,
  },

#1525

@posva posva closed this as completed Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants