nuxt / nuxt/bridge

Module parse failed: Unexpected token: import.meta

Open
#1,295 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending triage
Dominant language
TypeScript
Stars
285
Forks
33
Avg merge
22h 38m
Merged PRs (30d)
3

Description

Environment
- Operating System: Linux
- Node Version:     v18.20.3
- Nuxt Version:     2.18.1
- CLI Version:      3.13.0
- Nitro Version:    2.9.7
- Package Manager:  yarn@1.22.19
- Builder:          webpack
- User Config:      bridge, build, modules, ssr, serverHandlers, devServerHandlers, devServer, typescript, nitro, buildModules
- Runtime Modules:  @pinia/nuxt@0.5.4
- Build Modules:    (), @nuxt/bridge@3.3.1
Reproduction

https://stackblitz.com/edit/nuxt-bridge-reproduction?file=nuxt.config.ts

Describe the bug

As discussed in https://github.com/vuejs/pinia/pull/2622#issuecomment-2304813676, installing the latest version of @pinia/nuxt in a nuxt bridge project raises an error because import.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

image

Some reasons for the settings in the reproduction:

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and its nuxt.config.ts, using the webpack builder and the listed Nuxt Bridge and @pinia/nuxt versions. Compare the failing latest @pinia/nuxt version with a pre-PR-2622 version to identify the import.meta parsing boundary; done means the reproduction builds successfully without reverting the dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, nuxt, typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.