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

Turbopack "unreachable code" string causing warnings in Firefox #74185

Open
OleSkaar opened this issue Dec 20, 2024 · 0 comments
Open

Turbopack "unreachable code" string causing warnings in Firefox #74185

OleSkaar opened this issue Dec 20, 2024 · 0 comments
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.

Comments

@OleSkaar
Copy link

OleSkaar commented Dec 20, 2024

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

  1. Start the application with pnpm run dev
  2. Open the app at localhost:3000
  3. Check the browser console in Firefox. You should see several warnings about unreachable code:

Screenshot 2024-12-20 at 12 59 10

This is happening because of the "TURBOPACK unreachable"; statement that's inserted after the return statement in the code from react query dev tools:

Screenshot 2024-12-20 at 12 49 38

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

@OleSkaar OleSkaar added the bug Issue was opened via the bug report template. label Dec 20, 2024
@github-actions github-actions bot added 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. labels Dec 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. 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.
Projects
None yet
Development

No branches or pull requests

1 participant