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

Middleware source map is missing when in standalone mode #63694

Open
seanparmelee opened this issue Mar 26, 2024 · 0 comments
Open

Middleware source map is missing when in standalone mode #63694

seanparmelee opened this issue Mar 26, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@seanparmelee
Copy link
Contributor

Link to the code that reproduces this issue

https://github.com/seanparmelee/nextjs-middleware-source-map

To Reproduce

  1. Run npm run build
  2. Examine the .next/standalone/.next/server/ directory and note that middleware.js.map does not exist.
  3. Examine the .next/server/ directory and note that middleware.js.map does exist.

Current vs. Expected behavior

Expected Behavior

Given an application that's using middleware and built in standalone mode, I'd expect to find a .next/standalone/.next/server/middleware.js.map file as that's where the sourceMappingURL in .next/standalone/.next/server/middleware.js file is referencing.

Current Behavior

The .next/standalone/.next/server/middleware.js.map file does not exisst, but there is .next/server/middleware.js.map.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 20.11.0
  npm: 10.2.4
  Yarn: 1.22.19
  pnpm: 8.15.2
Relevant Packages:
  next: 14.2.0-canary.43 // Latest available version is detected (14.2.0-canary.43).
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: standalone

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

Middleware / Edge (API routes, runtime)

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

next build (local)

Additional context

We're ultimately copying the .next/standalone folder into a docker image and using @sentry/nextjs to upload the source maps so they can be incorporated into our Sentry issues. At the moment, it cannot find the source map for the middleware.ts file but I suspect we can workaround this in the meantime if we manually copy over the one from .next/server/.

@seanparmelee seanparmelee added the bug Issue was opened via the bug report template. label Mar 26, 2024
@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label Mar 26, 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. Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant