You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue is on a large codebase if a single instance of SourceMap (via Ark<SourceMap>) in Compiler is used for applying transforms as well as for minification ( as done by next-swc ), the BytePos fields gets overflowed in large repos.
thread '<unnamed>' panicked at <HOME_DIR>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_common-0.33.9/src/input.rs:31:9:
assertion failed: start <= end
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
### What?
Do not reuse `Compiler` instance.
### Why?
It exists only to support preserving comments from `print()` API for
modules created with `parse()` API, but it causes a problem for
`transform()` for very huge apps.
### How?
- Closesswc-project/swc#8932
- Fixes#48960
- Fixes#65436
### What?
Do not reuse `Compiler` instance.
### Why?
It exists only to support preserving comments from `print()` API for
modules created with `parse()` API, but it causes a problem for
`transform()` for very huge apps.
### How?
- Closesswc-project/swc#8932
- Fixesvercel#48960
- Fixesvercel#65436
Describe the bug
NextJS issue for reference: vercel/next.js#65436
Issue is on a large codebase if a single instance of
SourceMap
(viaArk<SourceMap>
) inCompiler
is used for applying transforms as well as for minification ( as done bynext-swc
), theBytePos
fields gets overflowed in large repos.Please check this repo and readme for more reference: https://github.com/rishabh3112/next-bug-large-repo?tab=readme-ov-file#investigations
Input code
https://github.com/rishabh3112/next-bug-large-repo?tab=readme-ov-file#investigations
Config
No response
Playground link (or link to the minimal reproduction)
https://github.com/rishabh3112/next-bug-large-repo
SWC Info output
No response
Expected behavior
Build to work fine
Actual behavior
Build breaks with:
Version
same as used by next in v4.0.4, latest and canary
Additional context
Raising this here as was suggested by @icyJoseph here: vercel/next.js#65436 (comment)
I am willing to contribute / discuss if needed to fix this issue.
The text was updated successfully, but these errors were encountered: