Open Vadorequest opened 1 year ago
This looks related to #1678
I believe you could either add regenerator-runtime
as a dependency or target >= ES2017
Using es2017
fixed it:
{
"minify": true,
"jsc": {
"minify": {
"compress": {
"unused": true
},
"mangle": false
},
"target": "es2017"
}
}
But installing regenerator-runtime
didn't fix anything. Still getting this after having it installed, using Yarn.
yarn build
yarn run v1.22.17
warning package.json: No license field
$ spack
thread '<unnamed>' panicked at 'internal error: entered unreachable code: module item found but is_es6 is false: Import(ImportDecl { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #567 }, specifiers: [Default(ImportDefaultSpecifier { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #0 }, local: Ident { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #360 }, sym: Atom('regeneratorRuntime' type=dynamic), optional: false } })], src: Str { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #0 }, value: Atom('regenerator-runtime' type=dynamic), has_escape: false, kind: Synthesized }, type_only: false, asserts: None })', crates/swc_bundler/src/bundler/chunk/cjs.rs:129:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: panic detected: internal error: entered unreachable code: module item found but is_es6 is false: Import(ImportDecl { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #567 }, specifiers: [Default(ImportDefaultSpecifier { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #0 }, local: Ident { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #360 }, sym: Atom('regeneratorRuntime' type=dynamic), optional: false } })], src: Str { span: Span { lo: BytePos(0), hi: BytePos(0), ctxt: #0 }, value: Atom('regenerator-runtime' type=dynamic), has_escape: false, kind: Synthesized }, type_only: false, asserts: None })] {
code: 'GenericFailure'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Ideally, I'd prefer to keep ES5 for better browser compatibility.
By upgrading all my swc deps, the error is now gone when running spack
.
This somehow helped: https://github.com/swc-project/swc/issues/1461
I need to test this on my production now, and see how it behaves.
When the script is compiled by GitHub Action, an error is thrown thread '<unnamed>' panicked at 'cannot access a scoped thread local variable without calling
setfirst', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:168:9
, but I don't know if it's related to that or to something else yet.
Opened https://github.com/swc-project/swc/issues/8058
Also, trying to figure out if Turbo can replace my Spack use-case: https://github.com/vercel/turbo/discussions/2350
Describe the bug
Video of the issue
watch.screencastify.com/v/0v4BQsUPP90OZf5iu8pQ
When compiling (using
spack
), it works on my local computer, but crashes on GitHub Actions. It is definitely related to async/await keywords.My first attempt, mixing both promises and async/await crashed. My second attempt, using only async/await crashed. My latest attempt, using only promises (.then/.catch) worked.
The playground link will not be useful, I couldn't reproduce the issue, I couldn't use spack in playground.
Input code
Config
Playground link
https://play.swc.rs/?version=1.2.142&code=H4sIAAAAAAAAA4WSW2vbQBCF3%2FUrhrxoDUKKSUOpjBOCLYLbEBfLpaQlOOvV6NKstGJ3lpCU%2FPeuLi5O%2BtB9kZid%2BeacwwrVGIIX3laov%2BO%2BVOrxm5YwB78kak0cRV3JhENHKFQ9FCLBSZTR9MPZ9PT808fozOJ5%2FSIjf%2BaJHplx4g7z2wN3NBaVIdSYLTlhDNag3rypBWOfUDpbZUPHZVhl3usAVBLDDPe2YP7PhTWkajBCVy3dw4JLWTUF%2FOglAimwrduOQCX2HDjJK23oRhUFZqumW7duUuLiEfVV255AXqHMAtfbYTrhsR%2F038nM83J0Rtn7hILRWY1UKqfX%2F7pOt%2F7gYq%2By5xg%2Bp%2Bvb0JB2zCp%2FZj0u8F4nfUvotDWMaTStM4cTmF%2F8jYqsbuBwE%2F4yqmFOR3f3z7CVdDT6n5zGfIYxZ3Ccdxa74SqHkXjpVHOyBuZz9wyMFQKN8Sfjku5IJbhMSWleYGiQVoQ1u0l3X5K7XXp3u0iWu01yvUq3ycb9Lq%2B2SQD%2B1D%2B4AJQGj3AH3ai10uzhve6kK4MSwmr3WOKHI%2BU97k00%2FbNkrEcdRUOlVk%2FQ4NNAG%2B8Pqc68P5QPjQcHAwAA&config=H4sIAAAAAAAAA1WPSw7DIAwF95wCed1tu%2BgdcghEnYiIn2wiFUW5e4FA2%2BzwvDFP3oWUsLKGp9zLswxRESN950I4%2B6TehQBqp1iTiQluI125RrOyjA0dZwJJ0YKpbfG962BDYBx6Z854M%2Bf%2FQh1cJGS%2BilVVfrF4rRO9Elx4bS3sh6Qc8ax%2FwE8aZYm29i8YnsZiZeL4ADoI3bUTAQAA
Expected behavior
Compile code.
Actual behavior
Error message
For some reason, the "Input code" (which is built fine using Spack on a local computer) crashes when built on GitHub Actions.
Version
1.2.142
Additional context