-
Notifications
You must be signed in to change notification settings - Fork 4
Description
When running bugsnag-cli upload js .next/ on a Next.js Turbopack build, the CLI crashes with:
open : no such file or directory
The error is missing the filename, which made this very hard to debug on our Vercel production builds.
What's happening: Turbopack uses independent content hashes for .js bundles and their .js.map files. A bundle abc123.js contains //# sourceMappingURL=def456.js.map. The map file exists on disk, but there is no def456.js. This is intentional on Turbopack's side (vercel/next.js#85471).
The crash happens because resolveBundlePath strips .map to find the bundle. When the file doesn't exist, it returns an empty string with no error. That empty string reaches os.Open(""), which panics.
Suggestions:
- When no bundle is found for a map file, skip it with a warning or return a clear error instead of crashing.
- Would you consider reading
//# sourceMappingURL=comments from.jsfiles to discover the actual pairing? The Turbopack maintainers consider this the standard mechanism (their response). It would work regardless of how the bundler names its output files.
Minimal repro with build output included: https://github.com/kaisermann/turbopack-sourcemap-repro