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

SWC Core throws / prints (misleading) error #8944

Closed
jd-carroll opened this issue May 11, 2024 · 5 comments
Closed

SWC Core throws / prints (misleading) error #8944

jd-carroll opened this issue May 11, 2024 · 5 comments
Labels

Comments

@jd-carroll
Copy link

jd-carroll commented May 11, 2024

Describe the bug

We are receiving hundreds of errors in our console using TSUP + @swc/core:

  ERROR  failed to read input source map: failed to parse inline source map url
index.js.map
Caused by:
    relative URL without a base
    at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.273.27/src/lib.rs:385

These errors seem to be thrown when the corresponding .js.map file is missing from the bundled sources.

It would be nice if @swc/core printed a more meaningful error message.

Note: I have no idea how to produce a repro, but I've spent a fair bit of time debugging this with console.log and I am relatively confident that this is the case.

Input code

No response

Config

No response

Playground link (or link to the minimal reproduction)

https://github.com/egoist/tsup/blob/00188a0dc848c48fac45de245d1e021f370a84a3/src/esbuild/swc.ts#L31-L49

SWC Info output

No response

Expected behavior

If an error is to be thrown / printed, print something more descriptive to the issue as well as a little more context.

Actual behavior

No response

Version

1.5.5

Additional context

Possibly related:
#8879
#8910
#8789 (comment)

Less likely related but will link anyways:
#8628

@jd-carroll
Copy link
Author

@davidmurdoch I am seeing the same behavior related to sentry. The issue is (of course) opentelemetry. A number of the published modules list source maps, such as:

//# sourceMappingURL=internal-types.js.map

But inspecting the installed module, the source maps do not exist.

@kdy1
Copy link
Member

kdy1 commented May 12, 2024

Closing as duplicate

@kdy1 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
@jd-carroll
Copy link
Author

@kdy1 duplicate to what?

@kdy1
Copy link
Member

kdy1 commented May 12, 2024

#8789

@swc-bot
Copy link
Collaborator

swc-bot commented Jun 11, 2024

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants