web-infra-dev / rslib

The Rsbuild powered package build tool.
https://lib.rsbuild.dev/
MIT License
376 stars 18 forks source link

[Bug]: Cannot get final name for export 'getSnap' #111

Closed zhangfisher closed 2 months ago

zhangfisher commented 2 months ago

Version

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 2.11 GB / 15.84 GB
  Browsers:
    Chrome: 122.0.6261.112
    Edge: Spartan (44.19041.1266.0), Chromium (119.0.2151.72)
    Internet Explorer: 11.0.19041.1566

Details

export default defineConfig({ lib: [ { format: 'esm', dts:{ bundle:true, },
output: { minify: true,
distPath: { root: './dist/esm', }, }, }, { format: 'cjs', dts:{ bundle:true, },
output: { minify: true, distPath: { root: './dist/cjs', }, }, }, ], source: { entry: { index: './src/index.ts', }, }, output: { target: 'node', }, });


run results:

```shell

  Rslib v0.0.2

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  Cannot get final name for export 'getSnap'
Location: crates\rspack_core\src\concatenated_module.rs:2133

Backtrace omitted.

Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
start   Generating DTS... (esm)
start   Generating DTS... (cjs)
ready   DTS generated in 5.35 s (esm)
ready   DTS generated in 6.12 s (cjs)
Analysis will use the bundled TypeScript version 5.0.4
*** The target project appears to use TypeScript 5.5.4 which is newer than the bundled compiler engine; consider upgrading API Extractor.
Analysis will use the bundled TypeScript version 5.0.4
*** The target project appears to use TypeScript 5.5.4 which is newer than the bundled compiler engine; consider upgrading API Extractor.

Reproduce link

https://github.com/zhangfisher/speed-form

Reproduce Steps

cd packages/reactive pnpm build:rslib

Timeless0911 commented 2 months ago

Thanks for your dogfooding~

The 'minify' option seems to be ineffective

minify was forcibly disabled by default and currently we does not support overriding it through configuration.

No ESM product was generated

Rslib is still in its early (dogfooding) stages. We plan to provide it to community users in one or two months. Now it still depends on a canary version of Rspack to make it work correctly.

Compared to TSUP, the speed seems to have not improved

We haven't done any performance optimization yet, and the main time-consuming step I think is probably tsc generating types.

xc2 commented 2 months ago

Cannot get final name for export 'getSnap' has been fixed by https://github.com/web-infra-dev/rspack/pull/7479 which was shipped with rspack 1.0.0-beta.4

yee94 commented 2 months ago

Same, Waiting for fix..