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

Relative baseUrl path in tsconfig.json causes base_dir(...) must be absolute error #63

Closed
Phryxia opened this issue Jan 30, 2024 · 3 comments · Fixed by #64
Closed

Relative baseUrl path in tsconfig.json causes base_dir(...) must be absolute error #63

Phryxia opened this issue Jan 30, 2024 · 3 comments · Fixed by #64

Comments

@Phryxia
Copy link

Phryxia commented Jan 30, 2024

  • Note that in tsconfig.json, baseUrl can be relative path. #reference
  • To reproduce, please checkout this repository.
    • It contains minimal reproduction files.
    • If you comment out baseUrl in tsconfig.json, npm run build will emit bundle.js
    • If you contain baseUrl in tsconfig.json, npm run build will cause errors like following:
> rollupswc-test@1.0.0 build
> rollup --config rollup.config.js


index.ts → bundle.js...
thread '<unnamed>' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_transforms_module-0.179.5/src/path.rs:122:13:
base_dir(`./src`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly.
@FranciscoKloganB
Copy link

FranciscoKloganB commented Apr 16, 2024

Just need to pass baseUrl: path.resolve('.') maybe this could be handled internally by the plugin?

Or import tsconfig from 'tsconfig.json' and pass baseUrl: path.resolve(tsconfig.baseUrl)

@SukkaW
Copy link
Owner

SukkaW commented Apr 16, 2024

That's weird. The issue should have been fixed by #44 and 20de029 and has already been released with version 0.10.1.

@SukkaW
Copy link
Owner

SukkaW commented Apr 16, 2024

@Phryxia @FranciscoKloganB @admon84

The issue has been fixed and 0.11.1 has been released.

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.

3 participants