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

Turbo is unable to compile source with pdfjs #70555

Open
Matts opened this issue Sep 27, 2024 · 0 comments
Open

Turbo is unable to compile source with pdfjs #70555

Matts opened this issue Sep 27, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Turbopack Related to Turbopack with Next.js.

Comments

@Matts
Copy link

Matts commented Sep 27, 2024

Link to the code that reproduces this issue

https://github.com/Matts/pdfjs-and-turbo-incompat

To Reproduce

See mozilla/pdf.js#18804 & vercel/turborepo#9195

Create a nextjs + turbo project
Follow the example installation at https://mozilla.github.io/pdf.js/examples/index.html#interactive-examples
You will receive a compilation error from turbopack (see image below)
it seems that turbo pre-interprets import statements and tries to resolve them. I see that there is a webpack ignore statement, possibly there has to be a similar statement for turbo

image

Current vs. Expected behavior

Currently, the server crashes even though everything should only be run on client, furthermore the actual piece of code is never even referenced or called.

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.7.0
  npm: 10.1.0
  Yarn: N/A
  pnpm: 8.6.10
Relevant Packages:
  next: 14.2.13 // Latest available version is detected (14.2.13).
  eslint-config-next: 14.2.13
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.6.2
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

No response

@Matts Matts added the bug Issue was opened via the bug report template. label Sep 27, 2024
@github-actions github-actions bot added the Turbopack Related to Turbopack with Next.js. label Sep 27, 2024
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. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant