Turbopack "unreachable code" string causing warnings in Firefox #74185
Labels
bug
Issue was opened via the bug report template.
Developer Experience
Issues related to Next.js logs, Error overlay, etc.
Module Resolution
Module resolution (CJS / ESM, module resolving).
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
https://github.com/OleSkaar/with-turbopack-app
I've used the with-turbopack example here, with two dependencies that were giving the same error in my project:
"@tanstack/react-query": "5.62.2", "@tanstack/react-query-devtools": "5.62.2",
To Reproduce
pnpm run dev
localhost:3000
This is happening because of the
"TURBOPACK unreachable";
statement that's inserted after the return statement in the code from react query dev tools:Current vs. Expected behavior
I expect being able to load up this project without warnings in the console.
I believe Firefox is detecting the
"TURBOPACK unreachable";
string as unreachable code and therefore reporting a warning (see this page).The string appears before a function declaration, and this seemed to be the case for the other warnings reported here as well. This function is declared below the return the statement, but because of hoisting it is reachable (and used) higher up in the code. Could the
"TURBOPACK unreachable";
string be inserted after the function declaration instead?Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030 Available memory (MB): 36864 Available CPU cores: 12 Binaries: Node: 20.13.1 npm: 10.5.2 Yarn: 1.22.22 pnpm: 9.14.4 Relevant Packages: next: 15.1.2 // Latest available version is detected (15.1.2). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.7.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Developer Experience, Module Resolution, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: