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

Sourcemap of script containing the ai library produces invalid sourcemap #4107

Closed
nipunn1313 opened this issue Mar 6, 2025 · 0 comments · Fixed by #4082
Closed

Sourcemap of script containing the ai library produces invalid sourcemap #4107

nipunn1313 opened this issue Mar 6, 2025 · 0 comments · Fixed by #4082

Comments

@nipunn1313
Copy link

nipunn1313 commented Mar 6, 2025

Repro

import { streamText } from "ai";
console.log(streamText);

ai at version 4.1.50
esbuild at version 0.25.0

npx esbuild repro.js --bundle --sourcemap --outfile=dist/repro.js

The generated dist/repro.js.map fails to parse on a variety of tools. Eg.
https://evanw.github.io/source-map-visualization/
https://www.npmjs.com/package/source-map-explorer
https://crates.io/crates/sourcemap

Errors are usually of this variety

The "mappings" field of the imported source map contains invalid data. Invalid VLQ data at index 147599: Original source index 124 is invalid (there are 123 sources).

repro.js.map.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants