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

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

Closed
zhangfisher opened this issue Aug 19, 2024 · 3 comments · Fixed by #122
Closed

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

zhangfisher opened this issue Aug 19, 2024 · 3 comments · Fixed by #122

Comments

@zhangfisher
Copy link

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

  • rslib.config.ts
import { defineConfig } from '@rslib/core';

 

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:

  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.
  • The 'minify' option seems to be ineffective
  • No ESM product was generated
  • Compared to TSUP, the speed seems to have not improved

Reproduce link

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

Reproduce Steps

cd packages/reactive
pnpm build:rslib

@Timeless0911
Copy link
Contributor

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
Copy link
Contributor

xc2 commented Aug 19, 2024

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

@yee94
Copy link

yee94 commented Aug 20, 2024

Same, Waiting for fix..

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

Successfully merging a pull request may close this issue.

4 participants