teunmooij / payload-tools

Collection of payload plugins and tools: payload-openapi, payload-swagger, create-payload-api-docs, payload-rbac
https://github.com/teunmooij/payload-tools/#readme
MIT License
90 stars 11 forks source link

[Bug]: error when trying to run #70

Open Dianoga opened 12 months ago

Dianoga commented 12 months ago

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

teunmooij commented 12 months ago

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

nathanclevenger commented 10 months ago

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