pdfjs-dist fails to compile with Turbopack (webpackIgnore comment not respected) #65406
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.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/pdf-viewer-forked-h3gdsc?file=%2Fcomponents%2FTestPage.tsx
To Reproduce
Module not found
(example: https://h3gdsc-3000.csb.app/)Current vs. Expected behavior
pdfjs-dist
ships with a webpack specific ignore comment (:til: that is a feature) as they useimport()
to load a file based on an option being passed in.Specifically
const worker = await import(/* webpackIgnore: true */ this.workerSrc);
fails to compile as it can't findthis.workerSrc
statically.I'm not sure what the best behavior is for this, adding support for the comment or ignoring such imports when they don't include a path.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Available memory (MB): 4102 Available CPU cores: 2 Binaries: Node: 20.12.0 npm: 10.5.0 Yarn: 1.22.19 pnpm: 8.15.6 Relevant Packages: next: 14.3.0-canary.40 // Latest available version is detected (14.3.0-canary.40). eslint-config-next: 14.1.0 react: 18.2.0 react-dom: 18.2.0 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), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
This is failing on all versions with Turbopack as it doesn't support the ignore comment.
PACK-3046
The text was updated successfully, but these errors were encountered: