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

Impossible to use worker_thread (server side) due to wrong path #67063

Open
ale-grosselle opened this issue Jun 20, 2024 · 0 comments
Open

Impossible to use worker_thread (server side) due to wrong path #67063

ale-grosselle opened this issue Jun 20, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Webpack Related to Webpack with Next.js.

Comments

@ale-grosselle
Copy link

Link to the code that reproduces this issue

https://github.com/ale-grosselle/worker-thread-bug

To Reproduce

  1. Clone this repository
  2. Run npm install
  3. Run npm run dev
  4. On the console you will see the following error: "uncaughtException: Error: Cannot find module _/_next/rsc_app_lib_create-invoice_ts.js

Current vs. Expected behavior

This statement:

new Worker(new URL('./create-invoice.ts', import.meta.url));

is being converted to the wrong path:
'/_next/_rsc_app_lib_create-invoice_ts.js' instead of '/_next/server/_rsc_app_lib_create-invoice_ts.js'

Screenshot 2024-06-20 at 14 26 51

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.12.1
  npm: 10.5.1
  Yarn: 1.22.19
  pnpm: 8.15.5
Relevant Packages:
  next: 15.0.0-canary.28 // There is a newer canary version (15.0.0-canary.38) available, please upgrade! 
  eslint-config-next: 15.0.0-rc.0
  react: 19.0.0-rc-6230622a1a-20240610
  react-dom: 19.0.0-rc-6230622a1a-20240610
  typescript: 5.2.2
Next.js Config:
  output: N/A
 ⚠ There is a newer canary version (15.0.0-canary.38) available, please upgrade! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

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

Webpack

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

next dev (local), next build (local)

Additional context

No response

@ale-grosselle ale-grosselle added the bug Issue was opened via the bug report template. label Jun 20, 2024
@github-actions github-actions bot added the Webpack Related to Webpack with Next.js. label Jun 20, 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. Webpack Related to Webpack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant