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

Turbopack fails to compile code referring to shiki though Webpack can compile it #69562

Open
exKAZUu opened this issue Sep 2, 2024 · 1 comment · May be fixed by #70258
Open

Turbopack fails to compile code referring to shiki though Webpack can compile it #69562

exKAZUu opened this issue Sep 2, 2024 · 1 comment · May be fixed by #70258
Labels
bug Issue was opened via the bug report template. linear: turbopack Confirmed issue that is tracked by the Turbopack team. Turbopack Related to Turbopack with Next.js.

Comments

@exKAZUu
Copy link

exKAZUu commented Sep 2, 2024

Link to the code that reproduces this issue

https://github.com/exKAZUu/turbopack-shiki-issue

To Reproduce

  1. git clone https://github.com/exKAZUu/turbopack-shiki-issue
  2. cd turbopack-shiki-issue
  3. npm install
  4. npm run dev (it works as expected WITHOUT --turbo flag)
  5. npm run dev-turbo (it DOESN'T work WITH --turbo flag. It shows the following error.)
 ⨯ ./node_modules/shiki/dist/index.mjs
Package shiki (serverExternalPackages or default list) can't be external
The request shiki matches serverExternalPackages (or the default list), but it can't be external:
The package seems invalid. require() resolves to a EcmaScript module, which would result in an error in Node.js.

Current vs. Expected behavior

npm run dev works well, but npm run dev-turbo doesn't work.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.7.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.0.0-canary.138 // Latest available version is detected (15.0.0-canary.138).
  eslint-config-next: N/A
  react: 19.0.0-rc-7771d3a7-20240827
  react-dom: 19.0.0-rc-7771d3a7-20240827
  typescript: 5.3.3
Next.js Config:
  output: N/A

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

Turbopack

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

next dev (local)

Additional context

I tested both Next.js 15.0.0-canary.138 and 14.2.7 and the results are same.
My reproduction repo is based on #64434 (comment)

@exKAZUu exKAZUu added the bug Issue was opened via the bug report template. label Sep 2, 2024
@github-actions github-actions bot added the Turbopack Related to Turbopack with Next.js. label Sep 2, 2024
@exKAZUu
Copy link
Author

exKAZUu commented Sep 2, 2024

Does #64525 relate to this issue ...?

@timneutkens timneutkens added the linear: turbopack Confirmed issue that is tracked by the Turbopack team. label Sep 10, 2024
@mischnic mischnic linked a pull request Sep 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. linear: turbopack Confirmed issue that is tracked by the Turbopack team. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants