-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Module parse failed: Unexpected token: import.meta #1295
Comments
We have checked that it works in the latest edge release. |
Thank you both 🙌 |
@wattanx hi, I still have the same problem. It looks like your example does not contain Check the repro here: https://stackblitz.com/edit/github-toccfh-mifppg?file=package.json |
@wattanx Thanks for your quick reply! When I run Also, when I run your example(stackblitz.com/edit/github-toccfh), I see the warning log below. Is that ignorable?
|
It was my mistake to say that installation is not necessary |
@wJoenn I've tested with my repro is here: https://stackblitz.com/edit/github-toccfh-mifppg Or did you confirm it's working as intended? |
No my bad, I'm in mobile right now so I didn't take the time to check your repro. Sorry about that. If edge doesn't work either then I suppose the fix doesn't work ? |
@wattanx Sorry to bother you, but did you confirm the behavior? If my repro is correct, could you please reopen the issue? Or should I create another issue? |
It seems that the issue hasn't been fixed, so I reopened it. |
import fs from "fs";
const target = "node_modules/@pinia/nuxt/dist/runtime/plugin.vue2.js";
const contents = fs
.readFileSync(target, { encoding: "utf-8" })
.replace("import.meta.server", "process.server");
fs.writeFileSync(target, contents); I worked around this problem by writing a fix script. It's useful until the issue is fixed properly. |
Environment
Reproduction
https://stackblitz.com/edit/nuxt-bridge-reproduction?file=nuxt.config.ts
Describe the bug
As discussed in vuejs/pinia#2622 (comment), installing the latest version of
@pinia/nuxt
in a nuxt bridge project raises an error becauseimport.meta
is not parsable.Reverting back to a version prior to the before-mentioned PR fixes the issue as it still uses
process
instead.Additional context
👋 @danielroe
Some reasons for the settings in the reproduction:
ssr: false
Support for Nitro/ESM Build #1144transpile: ['cookie-es']
You may need an additional loader to handle the result of these loaders../node_modules/@nuxt/bridge/dist/runtime/composables/cookie.mjs
#1281Logs
No response
The text was updated successfully, but these errors were encountered: