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

next-typesafe-url lib causes "ReferenceError: require is not defined" since canary v150 in dev mode with turbo #70186

Open
nctay opened this issue Sep 17, 2024 · 0 comments · May be fixed by #70255
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.

Comments

@nctay
Copy link

nctay commented Sep 17, 2024

Link to the code that reproduces this issue

https://github.com/nctay/NextJS-canary-require-issue

To Reproduce

  1. Start dev with --turbo
  2. Get error ReferenceError: require is not defined

Current vs. Expected behavior

Current behavior:

Getting error ReferenceError: require is not defined

Expected behavior:

No errors

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.14.0
  npm: 10.7.0
  Yarn: N/A
  pnpm: 9.4.0
Relevant Packages:
  next: 15.0.0-canary.157 // Latest available version is detected (15.0.0-canary.157).
  eslint-config-next: 14.2.11
  react: 19.0.0-rc-206df66e-20240912
  react-dom: 19.0.0-rc-206df66e-20240912
  typescript: 5.6.2
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)

Additional context

i tested my reproduction against different canary releaases, the first one than introduced the bug was "15.0.0-canary.150", since reverting to "15.0.0-canary.149" works.
Last version of next-typesafe-url 4.1.0 published long ago. Seems like there is an issue with bundling server code to user since canary v150.
No errors using next dev without turbo.

@nctay nctay added the bug Issue was opened via the bug report template. label Sep 17, 2024
@github-actions github-actions bot added the Turbopack Related to Turbopack with Next.js. label Sep 17, 2024
@timneutkens timneutkens added linear: turbopack Confirmed issue that is tracked by the Turbopack team. and removed linear: turbopack Confirmed issue that is tracked by the Turbopack team. labels Sep 19, 2024
@mischnic mischnic added linear: turbopack Confirmed issue that is tracked by the Turbopack team. and removed linear: turbopack Confirmed issue that is tracked by the Turbopack team. labels Sep 19, 2024
@mischnic mischnic linked a pull request Sep 19, 2024 that will close this issue
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. linear: turbopack Confirmed issue that is tracked by the Turbopack team. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants