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

bundle - Panic on arrays with 64 or more numbers #5891

Open
Nerixyz opened this issue Sep 18, 2022 · 3 comments
Open

bundle - Panic on arrays with 64 or more numbers #5891

Nerixyz opened this issue Sep 18, 2022 · 3 comments
Labels

Comments

@Nerixyz
Copy link

Nerixyz commented Sep 18, 2022

Describe the bug

When an input file for @swc/core's bundle() contains a declaration of an array with 64 or more numbers, bundle panics.

Input code

// foo.js
const foo = [
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
    1, 1, 1, 1,
];

Config

// index.js
// no .swcrc
const {bundle} = require('@swc/core');

(async () => {
    await bundle({
        entry: __dirname   '/foo.js',
        output: {
            path: __dirname,
            name: '/bar.js',
        },
        module: {},
    });
})();

Playground link

No response

Expected behavior

This should emit an empty file or a file that only contains this array.

Actual behavior

bundle panics:

thread '<unnamed>' panicked at 'cannot access a scoped thread local variable without calling `set` first', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:168:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace                                                                                                                                    
node:internal/process/promises:288                                                                                                                                                                               
            triggerUncaughtException(err, true /* fromPromise */);                                                                                                                                               
            ^                                                                                                                                                                                                    

[Error: panic detected] { code: 'GenericFailure' }

Node.js v18.0.0
With RUST_BACKTRACE=full
thread '<unnamed>' panicked at 'cannot access a scoped thread local variable without calling `set` first', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:168:9
stack backtrace:
   0:     0x7ffb16013f5f - wasmer_vm_raise_trap
   1:     0x7ffb16030eba - wasmer_vm_raise_trap
   2:     0x7ffb1600db49 - wasmer_vm_raise_trap
   3:     0x7ffb160169cb - wasmer_vm_raise_trap
   4:     0x7ffb1601664b - wasmer_vm_raise_trap
   5:     0x7ffb16016f79 - wasmer_vm_raise_trap
   6:     0x7ffb16e5535a - wasmer_vm_raise_trap
   7:     0x7ffb16e55327 - wasmer_vm_raise_trap
   8:     0x7ffb1771a6fd - wasmer_vm_raise_trap
   9:     0x7ffb16e13443 - wasmer_vm_raise_trap
  10:     0x7ffb16df0bdc - wasmer_vm_raise_trap
  11:     0x7ffb15f482f1 - wasmer_vm_raise_trap
  12:     0x7ffb15f4b42f - wasmer_vm_raise_trap
  13:     0x7ffb16def03c - wasmer_vm_raise_trap
  14:     0x7ffb15f47df4 - wasmer_vm_raise_trap
  15:     0x7ffb15f4a9d1 - wasmer_vm_raise_trap
  16:     0x7ffb15f4a922 - wasmer_vm_raise_trap
  17:     0x7ffb15f48f76 - wasmer_vm_raise_trap
  18:     0x7ffb15c86836 - Ordinal0
  19:     0x7ffb15c7d3c3 - Ordinal0
  20:     0x7ffb15b4634a - Ordinal0
  21:     0x7ffb15b9aa39 - Ordinal0
  22:     0x7ffb15b59396 - Ordinal0
  23:     0x7ffb15bda5ab - Ordinal0
  24:     0x7ffb15b13479 - Ordinal0
  25:     0x7ff70e1ebc3e - uv_queue_work
  26:     0x7ff70e1d7d4d - uv_poll_stop
  27:     0x7ff70f182060 - v8::internal::compiler::ToString
  28:     0x7ffb89e47034 - BaseThreadInitThunk
  29:     0x7ffb8a5e26a1 - RtlUserThreadStart
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: panic detected] { code: 'GenericFailure' }

Node.js v18.0.0

Version

1.3.1

Additional context

I reported this initially in swc-project/cli#163 but I realized the issue is in the bundle function which is in this repository.

Bundling foo.js with deno bundle foo.js and compiling it with npx swc foo.js works fine.

@Nerixyz Nerixyz added the C-bug label Sep 18, 2022
@Nerixyz
Copy link
Author

Nerixyz commented Sep 21, 2022

You can reproduce the panic by adding a test-case in node-swc:

diff --git a/node-swc/__tests__/spack/simple_test.js b/node-swc/__tests__/spack/simple_test.js
index ca041a6f9c..26b072476c 100644
--- a/node-swc/__tests__/spack/simple_test.js
    b/node-swc/__tests__/spack/simple_test.js
@@ -35,4  35,17 @@ it('should handle loader', async () => {
     console.log(result)
     expect(result.simple).toBeTruthy();
     expect(result.simple.code.replace('\n', '')).toBe(`console.log("Foo");`);
 });
 
 it('should handle arrays', async () => {
     const result = await swc.bundle({
         name: 'array',
         entry: {
             array: path.join(__dirname, '../../tests/spack/array/a.js')
         },
     });
 
     console.log(result)
     expect(result.array).toBeTruthy();
     expect(result.array.code.replace('\n', '')).toBe('');
 });
\ No newline at end of file
diff --git a/node-swc/tests/spack/array/a.js b/node-swc/tests/spack/array/a.js
new file mode 100644
index 0000000000..2236dcd59d
--- /dev/null
    b/node-swc/tests/spack/array/a.js
@@ -0,0  1,18 @@
 const foo = [
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
 ];
\ No newline at end of file

Then run the test script.


Running a repro with tracing
 INFO swc_ecma_loader::resolvers::tsc: jsc.paths base_url=
DEBUG swc_bundler::bundler: Helper ctxt: #1
DEBUG swc_bundler::bundler: Synthesized ctxt: #2
DEBUG swc_bundler::bundler: Injected ctxt: #3
TRACE swc_bundler::bundler::load: load_transformed: (\\?\G:\repro\input\index.js)
DEBUG swc_node_bundler::loaders::swc: JsLoader.load(\\?\G:\repro\input\index.js) 
TRACE swc_node_bundler::loaders::swc: JsLoader.load: loaded
 INFO parse_js_as_input: swc: new
 INFO parse_js_as_input: swc: enter
 INFO parse_js_as_input:Compiler.parse: swc: new
 INFO parse_js_as_input:Compiler.parse: swc: enter
 INFO parse_js_as_input:Compiler.parse:read_config: swc: new
 INFO parse_js_as_input:Compiler.parse:read_config: swc: enter
 INFO parse_js_as_input:Compiler.parse:read_config: swc: exit
 INFO parse_js_as_input:Compiler.parse:read_config: swc: close time.busy=4.88ms time.idle=1.26ms
 INFO parse_js_as_input:Compiler.parse:es2022: swc_ecma_transforms_compat::es2022: new
 INFO parse_js_as_input:Compiler.parse:es2022: swc_ecma_transforms_compat::es2022: enter
 INFO parse_js_as_input:Compiler.parse:es2022:static_blocks: swc_ecma_transforms_compat::es2022::static_blocks: new
 INFO parse_js_as_input:Compiler.parse:es2022:static_blocks: swc_ecma_transforms_compat::es2022::static_blocks: enter
 INFO parse_js_as_input:Compiler.parse:es2022:static_blocks: swc_ecma_transforms_compat::es2022::static_blocks: exit
 INFO parse_js_as_input:Compiler.parse:es2022:static_blocks: swc_ecma_transforms_compat::es2022::static_blocks: close time.busy=365µs time.idle=814µs
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties: swc_ecma_transforms_compat::es2022::class_properties: new
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties: swc_ecma_transforms_compat::es2022::class_properties: enter
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties:new: swc_ecma_transforms_compat::es2022::class_properties::private_field: new
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties:new: swc_ecma_transforms_compat::es2022::class_properties::private_field: enter
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties:new: swc_ecma_transforms_compat::es2022::class_properties::private_field: exit
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties:new: swc_ecma_transforms_compat::es2022::class_properties::private_field: close time.busy=455µs time.idle=819µs
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties: swc_ecma_transforms_compat::es2022::class_properties: exit
 INFO parse_js_as_input:Compiler.parse:es2022:class_properties: swc_ecma_transforms_compat::es2022::class_properties: close time.busy=2.13ms time.idle=706µs
 INFO parse_js_as_input:Compiler.parse:es2022: swc_ecma_transforms_compat::es2022: exit
 INFO parse_js_as_input:Compiler.parse:es2022: swc_ecma_transforms_compat::es2022: close time.busy=5.22ms time.idle=749µs
 INFO parse_js_as_input:Compiler.parse:es2021: swc_ecma_transforms_compat::es2021: new
 INFO parse_js_as_input:Compiler.parse:es2021: swc_ecma_transforms_compat::es2021: enter
 INFO parse_js_as_input:Compiler.parse:es2021:logical_assignments: swc_ecma_transforms_compat::es2021::logical_assignments: new
 INFO parse_js_as_input:Compiler.parse:es2021:logical_assignments: swc_ecma_transforms_compat::es2021::logical_assignments: enter
 INFO parse_js_as_input:Compiler.parse:es2021:logical_assignments: swc_ecma_transforms_compat::es2021::logical_assignments: exit
 INFO parse_js_as_input:Compiler.parse:es2021:logical_assignments: swc_ecma_transforms_compat::es2021::logical_assignments: close time.busy=547µs time.idle=905µs
 INFO parse_js_as_input:Compiler.parse:es2021: swc_ecma_transforms_compat::es2021: exit
 INFO parse_js_as_input:Compiler.parse:es2021: swc_ecma_transforms_compat::es2021: close time.busy=2.56ms time.idle=667µs
 INFO parse_js_as_input:Compiler.parse:es2020: swc_ecma_transforms_compat::es2020: new
 INFO parse_js_as_input:Compiler.parse:es2020: swc_ecma_transforms_compat::es2020: enter
 INFO parse_js_as_input:Compiler.parse:es2020:nullish_coalescing: swc_ecma_transforms_compat::es2020::nullish_coalescing: new
 INFO parse_js_as_input:Compiler.parse:es2020:nullish_coalescing: swc_ecma_transforms_compat::es2020::nullish_coalescing: enter
 INFO parse_js_as_input:Compiler.parse:es2020:nullish_coalescing: swc_ecma_transforms_compat::es2020::nullish_coalescing: exit
 INFO parse_js_as_input:Compiler.parse:es2020:nullish_coalescing: swc_ecma_transforms_compat::es2020::nullish_coalescing: close time.busy=368µs time.idle=754µs
 INFO parse_js_as_input:Compiler.parse:es2020:optional_chaining: swc_ecma_transforms_compat::es2020::opt_chaining: new
 INFO parse_js_as_input:Compiler.parse:es2020:optional_chaining: swc_ecma_transforms_compat::es2020::opt_chaining: enter
 INFO parse_js_as_input:Compiler.parse:es2020:optional_chaining: swc_ecma_transforms_compat::es2020::opt_chaining: exit
 INFO parse_js_as_input:Compiler.parse:es2020:optional_chaining: swc_ecma_transforms_compat::es2020::opt_chaining: close time.busy=347µs time.idle=704µs
 INFO parse_js_as_input:Compiler.parse:es2020:export_namespace_from: swc_ecma_transforms_compat::es2020::export_namespace_from: new
 INFO parse_js_as_input:Compiler.parse:es2020:export_namespace_from: swc_ecma_transforms_compat::es2020::export_namespace_from: enter
 INFO parse_js_as_input:Compiler.parse:es2020:export_namespace_from: swc_ecma_transforms_compat::es2020::export_namespace_from: exit
 INFO parse_js_as_input:Compiler.parse:es2020:export_namespace_from: swc_ecma_transforms_compat::es2020::export_namespace_from: close time.busy=381µs time.idle=733µs
 INFO parse_js_as_input:Compiler.parse:es2020: swc_ecma_transforms_compat::es2020: exit
 INFO parse_js_as_input:Compiler.parse:es2020: swc_ecma_transforms_compat::es2020: close time.busy=5.09ms time.idle=665µs
 INFO parse_js_as_input:Compiler.parse:es2019: swc_ecma_transforms_compat::es2019: new
 INFO parse_js_as_input:Compiler.parse:es2019: swc_ecma_transforms_compat::es2019: enter
 INFO parse_js_as_input:Compiler.parse:es2019:optional_catch_binding: swc_ecma_transforms_compat::es2019::optional_catch_binding: new
 INFO parse_js_as_input:Compiler.parse:es2019:optional_catch_binding: swc_ecma_transforms_compat::es2019::optional_catch_binding: enter
 INFO parse_js_as_input:Compiler.parse:es2019:optional_catch_binding: swc_ecma_transforms_compat::es2019::optional_catch_binding: exit
 INFO parse_js_as_input:Compiler.parse:es2019:optional_catch_binding: swc_ecma_transforms_compat::es2019::optional_catch_binding: close time.busy=317µs time.idle=630µs
 INFO parse_js_as_input:Compiler.parse:es2019: swc_ecma_transforms_compat::es2019: exit
 INFO parse_js_as_input:Compiler.parse:es2019: swc_ecma_transforms_compat::es2019: close time.busy=1.64ms time.idle=553µs
 INFO parse_js_as_input:Compiler.parse:es2018: swc_ecma_transforms_compat::es2018: new
 INFO parse_js_as_input:Compiler.parse:es2018: swc_ecma_transforms_compat::es2018: enter
 INFO parse_js_as_input:Compiler.parse:es2018:object_rest_spread: swc_ecma_transforms_compat::es2018::object_rest_spread: new
 INFO parse_js_as_input:Compiler.parse:es2018:object_rest_spread: swc_ecma_transforms_compat::es2018::object_rest_spread: enter
 INFO parse_js_as_input:Compiler.parse:es2018:object_rest_spread: swc_ecma_transforms_compat::es2018::object_rest_spread: exit
 INFO parse_js_as_input:Compiler.parse:es2018:object_rest_spread: swc_ecma_transforms_compat::es2018::object_rest_spread: close time.busy=282µs time.idle=542µs
 INFO parse_js_as_input:Compiler.parse:es2018: swc_ecma_transforms_compat::es2018: exit
 INFO parse_js_as_input:Compiler.parse:es2018: swc_ecma_transforms_compat::es2018: close time.busy=1.42ms time.idle=479µs
 INFO parse_js_as_input:Compiler.parse:es2017: swc_ecma_transforms_compat::es2017: new
 INFO parse_js_as_input:Compiler.parse:es2017: swc_ecma_transforms_compat::es2017: enter
 INFO parse_js_as_input:Compiler.parse:es2017:async_to_generator: swc_ecma_transforms_compat::es2017::async_to_generator: new
 INFO parse_js_as_input:Compiler.parse:es2017:async_to_generator: swc_ecma_transforms_compat::es2017::async_to_generator: enter
 INFO parse_js_as_input:Compiler.parse:es2017:async_to_generator: swc_ecma_transforms_compat::es2017::async_to_generator: exit
 INFO parse_js_as_input:Compiler.parse:es2017:async_to_generator: swc_ecma_transforms_compat::es2017::async_to_generator: close time.busy=280µs time.idle=812µs
 INFO parse_js_as_input:Compiler.parse:es2017: swc_ecma_transforms_compat::es2017: exit
 INFO parse_js_as_input:Compiler.parse:es2017: swc_ecma_transforms_compat::es2017: close time.busy=1.78ms time.idle=525µs
 INFO parse_js_as_input:Compiler.parse:es2016: swc_ecma_transforms_compat::es2016: new
 INFO parse_js_as_input:Compiler.parse:es2016: swc_ecma_transforms_compat::es2016: enter
 INFO parse_js_as_input:Compiler.parse:es2016:exponentiation: swc_ecma_transforms_compat::es2016::exponentiation: new
 INFO parse_js_as_input:Compiler.parse:es2016:exponentiation: swc_ecma_transforms_compat::es2016::exponentiation: enter
 INFO parse_js_as_input:Compiler.parse:es2016:exponentiation: swc_ecma_transforms_compat::es2016::exponentiation: exit
 INFO parse_js_as_input:Compiler.parse:es2016:exponentiation: swc_ecma_transforms_compat::es2016::exponentiation: close time.busy=288µs time.idle=565µs
 INFO parse_js_as_input:Compiler.parse:es2016: swc_ecma_transforms_compat::es2016: exit
 INFO parse_js_as_input:Compiler.parse:es2016: swc_ecma_transforms_compat::es2016: close time.busy=1.53ms time.idle=600µs
 INFO parse_js_as_input:Compiler.parse:es2015: swc_ecma_transforms_compat::es2015: new
 INFO parse_js_as_input:Compiler.parse:es2015: swc_ecma_transforms_compat::es2015: enter
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoped_functions: swc_ecma_transforms_compat::es2015::block_scoped_fn: new
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoped_functions: swc_ecma_transforms_compat::es2015::block_scoped_fn: enter
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoped_functions: swc_ecma_transforms_compat::es2015::block_scoped_fn: exit
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoped_functions: swc_ecma_transforms_compat::es2015::block_scoped_fn: close time.busy=358µs time.idle=658µs
 INFO parse_js_as_input:Compiler.parse:es2015:template_literal: swc_ecma_transforms_compat::es2015::template_literal: new
 INFO parse_js_as_input:Compiler.parse:es2015:template_literal: swc_ecma_transforms_compat::es2015::template_literal: enter
 INFO parse_js_as_input:Compiler.parse:es2015:template_literal: swc_ecma_transforms_compat::es2015::template_literal: exit
 INFO parse_js_as_input:Compiler.parse:es2015:template_literal: swc_ecma_transforms_compat::es2015::template_literal: close time.busy=348µs time.idle=659µs
 INFO parse_js_as_input:Compiler.parse:es2015:classes: swc_ecma_transforms_compat::es2015::classes: new
 INFO parse_js_as_input:Compiler.parse:es2015:classes: swc_ecma_transforms_compat::es2015::classes: enter
 INFO parse_js_as_input:Compiler.parse:es2015:classes: swc_ecma_transforms_compat::es2015::classes: exit
 INFO parse_js_as_input:Compiler.parse:es2015:classes: swc_ecma_transforms_compat::es2015::classes: close time.busy=300µs time.idle=580µs
 INFO parse_js_as_input:Compiler.parse:es2015:new_target: swc_ecma_transforms_compat::es2015::new_target: new
 INFO parse_js_as_input:Compiler.parse:es2015:new_target: swc_ecma_transforms_compat::es2015::new_target: enter
 INFO parse_js_as_input:Compiler.parse:es2015:new_target: swc_ecma_transforms_compat::es2015::new_target: exit
 INFO parse_js_as_input:Compiler.parse:es2015:new_target: swc_ecma_transforms_compat::es2015::new_target: close time.busy=268µs time.idle=521µs
 INFO parse_js_as_input:Compiler.parse:es2015:object_super: swc_ecma_transforms_compat::es2015::object_super: new
 INFO parse_js_as_input:Compiler.parse:es2015:object_super: swc_ecma_transforms_compat::es2015::object_super: enter
 INFO parse_js_as_input:Compiler.parse:es2015:object_super: swc_ecma_transforms_compat::es2015::object_super: exit
 INFO parse_js_as_input:Compiler.parse:es2015:object_super: swc_ecma_transforms_compat::es2015::object_super: close time.busy=284µs time.idle=577µs
 INFO parse_js_as_input:Compiler.parse:es2015:shorthand: swc_ecma_transforms_compat::es2015::shorthand_property: new
 INFO parse_js_as_input:Compiler.parse:es2015:shorthand: swc_ecma_transforms_compat::es2015::shorthand_property: enter
 INFO parse_js_as_input:Compiler.parse:es2015:shorthand: swc_ecma_transforms_compat::es2015::shorthand_property: exit
 INFO parse_js_as_input:Compiler.parse:es2015:shorthand: swc_ecma_transforms_compat::es2015::shorthand_property: close time.busy=263µs time.idle=529µs
 INFO parse_js_as_input:Compiler.parse:es2015:function_name: swc_ecma_transforms_compat::es2015::function_name: new
 INFO parse_js_as_input:Compiler.parse:es2015:function_name: swc_ecma_transforms_compat::es2015::function_name: enter
 INFO parse_js_as_input:Compiler.parse:es2015:function_name: swc_ecma_transforms_compat::es2015::function_name: exit
 INFO parse_js_as_input:Compiler.parse:es2015:function_name: swc_ecma_transforms_compat::es2015::function_name: close time.busy=321µs time.idle=578µs
 INFO parse_js_as_input:Compiler.parse:es2015:exprs: swc_ecma_transforms_compat::es2015: new
 INFO parse_js_as_input:Compiler.parse:es2015:exprs: swc_ecma_transforms_compat::es2015: enter
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:arrow: swc_ecma_transforms_compat::es2015::arrow: new
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:arrow: swc_ecma_transforms_compat::es2015::arrow: enter
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:arrow: swc_ecma_transforms_compat::es2015::arrow: exit
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:arrow: swc_ecma_transforms_compat::es2015::arrow: close time.busy=446µs time.idle=752µs
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:sticky_regex: swc_ecma_transforms_compat::es2015::sticky_regex: new
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:sticky_regex: swc_ecma_transforms_compat::es2015::sticky_regex: enter
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:sticky_regex: swc_ecma_transforms_compat::es2015::sticky_regex: exit
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:sticky_regex: swc_ecma_transforms_compat::es2015::sticky_regex: close time.busy=414µs time.idle=797µs
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:instance_of: swc_ecma_transforms_compat::es2015::instanceof: new
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:instance_of: swc_ecma_transforms_compat::es2015::instanceof: enter
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:instance_of: swc_ecma_transforms_compat::es2015::instanceof: exit
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:instance_of: swc_ecma_transforms_compat::es2015::instanceof: close time.busy=386µs time.idle=825µs
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:typeof_symbol: swc_ecma_transforms_compat::es2015::typeof_symbol: new
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:typeof_symbol: swc_ecma_transforms_compat::es2015::typeof_symbol: enter
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:typeof_symbol: swc_ecma_transforms_compat::es2015::typeof_symbol: exit
 INFO parse_js_as_input:Compiler.parse:es2015:exprs:typeof_symbol: swc_ecma_transforms_compat::es2015::typeof_symbol: close time.busy=348µs time.idle=755µs
 INFO parse_js_as_input:Compiler.parse:es2015:exprs: swc_ecma_transforms_compat::es2015: exit
 INFO parse_js_as_input:Compiler.parse:es2015:exprs: swc_ecma_transforms_compat::es2015: close time.busy=6.84ms time.idle=627µs
 INFO parse_js_as_input:Compiler.parse:es2015:for_of: swc_ecma_transforms_compat::es2015::for_of: new
 INFO parse_js_as_input:Compiler.parse:es2015:for_of: swc_ecma_transforms_compat::es2015::for_of: enter
 INFO parse_js_as_input:Compiler.parse:es2015:for_of: swc_ecma_transforms_compat::es2015::for_of: exit
 INFO parse_js_as_input:Compiler.parse:es2015:for_of: swc_ecma_transforms_compat::es2015::for_of: close time.busy=365µs time.idle=732µs
 INFO parse_js_as_input:Compiler.parse:es2015:parameters: swc_ecma_transforms_compat::es2015::parameters: new
 INFO parse_js_as_input:Compiler.parse:es2015:parameters: swc_ecma_transforms_compat::es2015::parameters: enter
 INFO parse_js_as_input:Compiler.parse:es2015:parameters: swc_ecma_transforms_compat::es2015::parameters: exit
 INFO parse_js_as_input:Compiler.parse:es2015:parameters: swc_ecma_transforms_compat::es2015::parameters: close time.busy=312µs time.idle=589µs
 INFO parse_js_as_input:Compiler.parse:es2015:computed_properties: swc_ecma_transforms_compat::es2015::computed_props: new
 INFO parse_js_as_input:Compiler.parse:es2015:computed_properties: swc_ecma_transforms_compat::es2015::computed_props: enter
 INFO parse_js_as_input:Compiler.parse:es2015:computed_properties: swc_ecma_transforms_compat::es2015::computed_props: exit
 INFO parse_js_as_input:Compiler.parse:es2015:computed_properties: swc_ecma_transforms_compat::es2015::computed_props: close time.busy=271µs time.idle=529µs
 INFO parse_js_as_input:Compiler.parse:es2015:destructuring: swc_ecma_transforms_compat::es2015::destructuring: new
 INFO parse_js_as_input:Compiler.parse:es2015:destructuring: swc_ecma_transforms_compat::es2015::destructuring: enter
 INFO parse_js_as_input:Compiler.parse:es2015:destructuring: swc_ecma_transforms_compat::es2015::destructuring: exit
 INFO parse_js_as_input:Compiler.parse:es2015:destructuring: swc_ecma_transforms_compat::es2015::destructuring: close time.busy=268µs time.idle=528µs
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoping: swc_ecma_transforms_compat::es2015::block_scoping: new
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoping: swc_ecma_transforms_compat::es2015::block_scoping: enter
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoping: swc_ecma_transforms_compat::es2015::block_scoping: exit
 INFO parse_js_as_input:Compiler.parse:es2015:block_scoping: swc_ecma_transforms_compat::es2015::block_scoping: close time.busy=282µs time.idle=540µs
 INFO parse_js_as_input:Compiler.parse:es2015: swc_ecma_transforms_compat::es2015: exit
 INFO parse_js_as_input:Compiler.parse:es2015: swc_ecma_transforms_compat::es2015: close time.busy=23.5ms time.idle=863µs
 INFO parse_js_as_input:Compiler.parse:es3: swc_ecma_transforms_compat::es3: new
 INFO parse_js_as_input:Compiler.parse:es3: swc_ecma_transforms_compat::es3: enter
 INFO parse_js_as_input:Compiler.parse:es3:property_literals: swc_ecma_transforms_compat::es3::prop_lits: new
 INFO parse_js_as_input:Compiler.parse:es3:property_literals: swc_ecma_transforms_compat::es3::prop_lits: enter
 INFO parse_js_as_input:Compiler.parse:es3:property_literals: swc_ecma_transforms_compat::es3::prop_lits: exit
 INFO parse_js_as_input:Compiler.parse:es3:property_literals: swc_ecma_transforms_compat::es3::prop_lits: close time.busy=423µs time.idle=720µs
 INFO parse_js_as_input:Compiler.parse:es3:member_expression_literals: swc_ecma_transforms_compat::es3::member_expr_lits: new
 INFO parse_js_as_input:Compiler.parse:es3:member_expression_literals: swc_ecma_transforms_compat::es3::member_expr_lits: enter
 INFO parse_js_as_input:Compiler.parse:es3:member_expression_literals: swc_ecma_transforms_compat::es3::member_expr_lits: exit
 INFO parse_js_as_input:Compiler.parse:es3:member_expression_literals: swc_ecma_transforms_compat::es3::member_expr_lits: close time.busy=326µs time.idle=637µs
 INFO parse_js_as_input:Compiler.parse:es3:reserved_words: swc_ecma_transforms_compat::es3::reserved_word: new
 INFO parse_js_as_input:Compiler.parse:es3:reserved_words: swc_ecma_transforms_compat::es3::reserved_word: enter
 INFO parse_js_as_input:Compiler.parse:es3:reserved_words: swc_ecma_transforms_compat::es3::reserved_word: exit
 INFO parse_js_as_input:Compiler.parse:es3:reserved_words: swc_ecma_transforms_compat::es3::reserved_word: close time.busy=321µs time.idle=604µs
 INFO parse_js_as_input:Compiler.parse:es3: swc_ecma_transforms_compat::es3: exit
 INFO parse_js_as_input:Compiler.parse:es3: swc_ecma_transforms_compat::es3: close time.busy=4.73ms time.idle=538µs
 INFO parse_js_as_input:Compiler.parse: swc_timer: Done in 66.5038ms kind="perf"
 INFO parse_js_as_input:Compiler.parse: swc: exit
 INFO parse_js_as_input:Compiler.parse: swc: close time.busy=67.2ms time.idle=618µs
 INFO parse_js_as_input: swc: exit
 INFO parse_js_as_input: swc: close time.busy=68.5ms time.idle=549µs
TRACE swc_node_bundler::loaders::swc: JsLoader.load: loaded config
DEBUG swc_ecma_transforms_base::rename::analyzer::scope: Renaming `foo#4` to `foo`
TRACE swc_node_bundler::loaders::swc: JsLoader.load: applied transforms
TRACE swc_bundler::bundler::load: transform_module(\\?\G:\CLionProjects\swcrash\input\index.js)
TRACE swc_bundler::bundler::load: resolve_exports(\\?\G:\CLionProjects\swcrash\input\index.js)
TRACE swc_bundler::bundler::load: resolve_imports(\\?\G:\CLionProjects\swcrash\input\index.js)
DEBUG swc_bundler::bundler::load: (ModuleId(0), #7, #8) Storing module: \\?\G:\CLionProjects\swcrash\input\index.js
DEBUG swc_bundler::bundler::chunk: Dependency analysis took 155.2µs
DEBUG swc_bundler::bundler::chunk: Module preparation took 364.3µs
DEBUG swc_bundler::bundler::chunk::merge: Merging dependencies: {}
TRACE swc_bundler::bundler::chunk::merge: All modules are merged
DEBUG swc_bundler::bundler::chunk::merge: Injecting reexports
DEBUG swc_bundler::bundler::chunk::merge: Inlining injected variables
DEBUG swc_bundler::inline: Inlining injected variables
DEBUG swc_bundler::modules::sort: Sorting ModuleId(0)
DEBUG swc_bundler::modules::sort::chunk: Topologically sorting modules based on the dependency graph: (1 items)
DEBUG swc_bundler::modules::sort::chunk: Toposort of module ids took 32.3µs
DEBUG swc_bundler::modules::sort: Sorting took 481.9µs
DEBUG swc_bundler::modules::sort: Sorted ModuleId(0)
DEBUG swc_bundler::bundler::chunk::merge: Renaming keywords
DEBUG swc_bundler::bundler::chunk::merge: Removing wrong exports
TRACE swc_bundler::bundler::chunk::merge: Item count = 1
DEBUG swc_bundler::bundler::chunk::merge: Removed wrong exports
DEBUG swc_bundler::bundler::chunk: Merged `0` and it's dep into an entry
ERROR tree-shaker{pass=1}: swc_ecma_transforms_optimization::simplify::dce: new
ERROR tree-shaker{pass=1}: swc_ecma_transforms_optimization::simplify::dce: enter
thread 'main' panicked at 'You should perform this operation in the closure passed to `set` of swc_common::errors::HANDLER', D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\better_scoped_tls-0.1.0\src\lib.rs:67:13
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/eaadb8947b850a025404082f6297766c4680a42a/library\std\src\panicking.rs:584
   1: core::panicking::panic_fmt
             at /rustc/eaadb8947b850a025404082f6297766c4680a42a/library\core\src\panicking.rs:142
   2: better_scoped_tls::ScopedKey<swc_common::errors::Handler>::with<swc_common::errors::Handler,swc_ecma_transforms_base::perf::impl$1::visit_mut_par::closure$0::closure$0::closure_env$0<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,enum2$<core
:
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\better_scoped_tls-0.1.0\src\lib.rs:67
   3: swc_ecma_transforms_base::perf::impl$1::visit_mut_par::closure$0::closure$0<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,enum2$<core::option::Option<swc_ecma_ast::expr::ExprOrSpread> > >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_base-0.108.17\src\perf.rs:113
   4: scoped_tls::ScopedKey<swc_ecma_transforms_base::helpers::Helpers>::with<swc_ecma_transforms_base::helpers::Helpers,swc_ecma_transforms_base::perf::impl$1::visit_mut_par::closure$0::closure_env$0<swc_ecma_transforms_optimization::simplify::dce::TreeShaker
,
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:171
   5: better_scoped_tls::ScopedKey<swc_ecma_transforms_base::helpers::Helpers>::with<swc_ecma_transforms_base::helpers::Helpers,swc_ecma_transforms_base::perf::impl$1::visit_mut_par::closure$0::closure_env$0<swc_ecma_transforms_optimization::simplify::dce::Tre
e
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\better_scoped_tls-0.1.0\src\lib.rs:73
   6: swc_ecma_transforms_base::perf::impl$1::visit_mut_par::closure$0<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,enum2$<core::option::Option<swc_ecma_ast::expr::ExprOrSpread> > >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_base-0.108.17\src\perf.rs:112
   7: scoped_tls::ScopedKey<swc_common::syntax_pos::Globals>::with<swc_common::syntax_pos::Globals,swc_ecma_transforms_base::perf::impl$1::visit_mut_par::closure_env$0<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,enum2$<core::option::Option<swc_
e
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:171
   8: better_scoped_tls::ScopedKey<swc_common::syntax_pos::Globals>::with<swc_common::syntax_pos::Globals,swc_ecma_transforms_base::perf::impl$1::visit_mut_par::closure_env$0<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,enum2$<core::option::Opti
o
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\better_scoped_tls-0.1.0\src\lib.rs:73
   9: swc_ecma_transforms_base::perf::impl$1::visit_mut_par<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,enum2$<core::option::Option<swc_ecma_ast::expr::ExprOrSpread> > >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_base-0.108.17\src\perf.rs:111
  10: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_opt_vec_expr_or_spreads
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:1026
  11: swc_ecma_visit::visit_mut_array_lit<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  12: swc_ecma_visit::VisitMut::visit_mut_array_lit<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  13: swc_ecma_visit::visit_mut_expr<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  14: swc_ecma_visit::impl$681::visit_mut_children_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  15: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_expr
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:723
  16: swc_ecma_visit::visit_mut_opt_expr<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  17: swc_ecma_visit::VisitMut::visit_mut_opt_expr<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  18: swc_ecma_visit::visit_mut_var_declarator<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  19: swc_ecma_visit::impl$908::visit_mut_children_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  20: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_var_declarator
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:975
  21: swc_ecma_visit::impl$908::visit_mut_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  22: swc_ecma_transforms_base::perf::impl$1::visit_mut_par<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,swc_ecma_ast::decl::VarDeclarator>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_base-0.108.17\src\perf.rs:148
  23: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_var_declarators
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:995
  24: swc_ecma_visit::visit_mut_var_decl<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  25: swc_ecma_visit::impl$904::visit_mut_children_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  26: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_var_decl
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:970
  27: swc_ecma_visit::visit_mut_decl<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  28: swc_ecma_visit::impl$666::visit_mut_children_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  29: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_decl
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:659
  30: swc_ecma_visit::visit_mut_stmt<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  31: swc_ecma_visit::impl$805::visit_mut_children_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  32: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_stmt
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:885
  33: swc_ecma_visit::visit_mut_module_item<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  34: swc_ecma_visit::impl$739::visit_mut_children_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  35: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_module_item
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:873
  36: swc_ecma_visit::impl$739::visit_mut_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  37: swc_ecma_transforms_base::perf::impl$1::visit_mut_par<swc_ecma_transforms_optimization::simplify::dce::TreeShaker,enum2$<swc_ecma_ast::module::ModuleItem> >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_base-0.108.17\src\perf.rs:148
  38: swc_ecma_transforms_optimization::simplify::dce::TreeShaker::visit_mut_stmt_likes<enum2$<swc_ecma_ast::module::ModuleItem> >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:565
  39: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_module_items
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:881
  40: swc_ecma_visit::visit_mut_module<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  41: swc_ecma_visit::impl$736::visit_mut_children_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  42: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_module::closure$0
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:825
  43: scoped_tls::ScopedKey<swc_ecma_transforms_base::helpers::Helpers>::set<swc_ecma_transforms_base::helpers::Helpers,swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_module::closure_env$0,tuple$<> >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:137
  44: better_scoped_tls::ScopedKey<swc_ecma_transforms_base::helpers::Helpers>::set<swc_ecma_transforms_base::helpers::Helpers,swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_module::closure_env$0,tuple$<> >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\better_scoped_tls-0.1.0\src\lib.rs:55
  45: swc_ecma_transforms_optimization::simplify::dce::impl$8::visit_mut_module
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_transforms_optimization-0.162.23\src\simplify\dce\mod.rs:824
  46: swc_ecma_visit::impl$736::visit_mut_with<swc_ecma_transforms_optimization::simplify::dce::TreeShaker>
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  47: swc_ecma_visit::impl$10::fold_module
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:288
  48: swc_ecma_visit::impl$135::fold_with<swc_ecma_visit::Folder<swc_ecma_transforms_optimization::simplify::dce::TreeShaker> >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  49: swc_ecma_visit::impl$3::fold_module<swc_ecma_visit::Folder<swc_ecma_transforms_optimization::simplify::dce::TreeShaker> >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:75
  50: swc_ecma_visit::impl$135::fold_with<swc_visit::Repeat<swc_ecma_visit::Folder<swc_ecma_transforms_optimization::simplify::dce::TreeShaker> > >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_ecma_visit-0.77.8\src\lib.rs:497
  51: swc_bundler::bundler::optimize::impl$0::optimize::closure$0<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Box<dyn$<swc_ecma_loader::resolve::Resolve>,alloc::alloc::Global> > >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_bundler-0.187.30\src\bundler\optimize.rs:23
  52: scoped_tls::ScopedKey<swc_common::syntax_pos::Globals>::set<swc_common::syntax_pos::Globals,swc_bundler::bundler::optimize::impl$0::optimize::closure_env$0<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Bo
x
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:137
  53: better_scoped_tls::ScopedKey<swc_common::syntax_pos::Globals>::set<swc_common::syntax_pos::Globals,swc_bundler::bundler::optimize::impl$0::optimize::closure_env$0<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::bo
x
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\better_scoped_tls-0.1.0\src\lib.rs:55
  54: swc_bundler::bundler::Bundler<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Box<dyn$<swc_ecma_loader::resolve::Resolve>,alloc::alloc::Global> > >::run<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,
a
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_bundler-0.187.30\src\bundler\mod.rs:218
  55: swc_bundler::bundler::Bundler<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Box<dyn$<swc_ecma_loader::resolve::Resolve>,alloc::alloc::Global> > >::optimize<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::L
o
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_bundler-0.187.30\src\bundler\optimize.rs:18
  56: swc_bundler::bundler::finalize::impl$0::finalize::closure$0<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Box<dyn$<swc_ecma_loader::resolve::Resolve>,alloc::alloc::Global> > >
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_bundler-0.187.30\src\bundler\finalize.rs:35
  57: scoped_tls::ScopedKey<swc_common::syntax_pos::Globals>::set<swc_common::syntax_pos::Globals,swc_bundler::bundler::finalize::impl$0::finalize::closure_env$0<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Bo
x
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\scoped-tls-1.0.0\src\lib.rs:137
  58: better_scoped_tls::ScopedKey<swc_common::syntax_pos::Globals>::set<swc_common::syntax_pos::Globals,swc_bundler::bundler::finalize::impl$0::finalize::closure_env$0<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::bo
x
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\better_scoped_tls-0.1.0\src\lib.rs:55
  59: swc_bundler::bundler::Bundler<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Box<dyn$<swc_ecma_loader::resolve::Resolve>,alloc::alloc::Global> > >::run<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,
a
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_bundler-0.187.30\src\bundler\mod.rs:218
  60: swc_bundler::bundler::Bundler<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Box<dyn$<swc_ecma_loader::resolve::Resolve>,alloc::alloc::Global> > >::finalize<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::L
o
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_bundler-0.187.30\src\bundler\finalize.rs:30
  61: swc_bundler::bundler::Bundler<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Load>,alloc::alloc::Global> >,ref$<alloc::boxed::Box<dyn$<swc_ecma_loader::resolve::Resolve>,alloc::alloc::Global> > >::bundle<ref$<alloc::boxed::Box<dyn$<swc_bundler::load::Loa
d
             at D:\Rust\cargo\registry\src\github.com-1ecc6299db9ec823\swc_bundler-0.187.30\src\bundler\mod.rs:201
  62: swcrash::bundle::bundle_internal
             at .\src\bundle.rs:100
  63: swcrash::bundle::bundle
             at .\src\bundle.rs:63
  64: swcrash::main
             at .\src\main.rs:19
  65: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/eaadb8947b850a025404082f6297766c4680a42a\library\core\src\ops\function.rs:248
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
ERROR tree-shaker{pass=1}: swc_ecma_transforms_optimization::simplify::dce: exit
ERROR tree-shaker{pass=1}: swc_ecma_transforms_optimization::simplify::dce: close time.busy=600ms time.idle=590µs

@Tronix117
Copy link

Tronix117 commented Apr 17, 2023

It does the same with an object with at least 8 keys :

console.log({
  a: null,
  b: null,
  c: null,
  d: null,
  e: null,
  f: null,
  g: null,
  h: null,
});

In a docker container using node image, just spack on this code and we get the error.
Couldn't find a workaround, I have no special settings, nothing, just this code in a main.ts.
Also unusable for me at this stade.

Works fine using swc or outside of docker container

@Tjerk-Haaye-Henricus
Copy link

Same issue here: Did you manage to make it work ?

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

No branches or pull requests

3 participants