Thanks to visit codestin.com
Credit goes to github.com

Skip to content

import.meta.resolve isn't supported by Next.js #77157

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

Closed
AugustinMauroy opened this issue Mar 15, 2025 · 2 comments
Closed

import.meta.resolve isn't supported by Next.js #77157

AugustinMauroy opened this issue Mar 15, 2025 · 2 comments
Labels
SWC Related to minification/transpilation in Next.js.

Comments

@AugustinMauroy
Copy link
Contributor

AugustinMauroy commented Mar 15, 2025

Link to the code that reproduces this issue

nodejs/nodejs.org#7544

To Reproduce

npm run build on root

Current vs. Expected behavior

current behavior
in dev with Webpack: Critical dependency: Accessing import.meta directly is unsupported (only property access or destructuring is supported)
in dev with Turbopack TypeError: __TURBOPACK__import$2e$meta__.resolve is not a function
in build TypeError: {}.resolve is not a function

expected behavior: build pass

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:06 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8103
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 15.2.0 // There is a newer version (15.2.2) available, upgrade recommended! 
  eslint-config-next: 15.2.0
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

SWC or Bundler

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed), next build (local), next dev (local)

Additional context

The rehype plugin that we want use, use import.meta.resolve.

So it's may come form SWC during transformation or bundler.

@github-actions github-actions bot added the SWC Related to minification/transpilation in Next.js. label Mar 15, 2025
@avivkeller
Copy link

(FYI #75292 might be documenting the same issue)

@timneutkens
Copy link
Member

Duplicate of #75292

@timneutkens timneutkens marked this as a duplicate of #75292 Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SWC Related to minification/transpilation in Next.js.
Projects
None yet
Development

No branches or pull requests

3 participants