Impossible to use worker_thread (server side) due to wrong path
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, next.js, typescript, webpack
- Domain
- backend, build-system
Research direction
Clone the reproduction repository at the linked URL, run npm install and npm run dev, then compare the generated worker path with the expected /_next/server/ location. Check whether the same resolution problem occurs during next build; done means the server-side worker resolves correctly in both next dev and next build.
Written by the indexing model from the issue text.
Description
Link to the code that reproduces this issue
https://github.com/ale-grosselle/worker-thread-bug
To Reproduce
- Clone this repository
- Run
npm install - Run
npm run dev - 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'
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
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.5k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 334
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vercel/next.js
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Image (next/image)
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Loading UI and Streaming
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100