payload-tools icon indicating copy to clipboard operation
payload-tools copied to clipboard

[Bug]: error when trying to run

Open Dianoga opened this issue 1 year ago • 2 comments

Package name

payload-openapi

What happened?

When I try to run this I get the following error. I did a quick look at the source and tried setting the tsconfig baseUrl but that didn't fix it.

Any pointers?

❯ npx create-payload-api-docs -c src/config.ts                                                                                                                                 [13:45:25]
thread '<unnamed>' panicked at 'base_dir(`./`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other works, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.', /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_transforms_module-0.175.3/src/path.rs:104:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to handle: base_dir(`./`) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly. This cannot be deduced by SWC itself because SWC is a transpiler and it does not try to resolve project details. In other works, SWC does not know which directory should be used as a base directory. It can be deduced if `.swcrc` is used, but if not, there are many candidates. e.g. the directory containing `package.json`, or the current working directory. Because of that, the caller (typically the developer of the JavaScript package) should specify it. If you see this error, please report an issue to the package author.

What did you expect

No response

Setps to reproduce

This was a pretty barebones setup. I installed create-payload-api-docs as a dev dependency and tried to run it as described.

Tool version

1.4.0

Payload version

1.14.0

Node version

18.17.1

Dianoga avatar Aug 30 '23 18:08 Dianoga

Thanks for reporting this issue. Looks like some internal change in payload. I'll look into it

teunmooij avatar Aug 30 '23 18:08 teunmooij

I'm getting this same issue as well - unable to run payload-openapi at all

nathanclevenger avatar Oct 20 '23 11:10 nathanclevenger