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]: SWC Error: base_dir must be absolute & Error "db" is not allowed #83

Open
ainsleyclark opened this issue Mar 9, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ainsleyclark
Copy link

ainsleyclark commented Mar 9, 2024

Package name

create-payload-api-docs
payload-openapi

What happened?

I'm wanting to generate an openapi spec from the CLI tool.

When running the command npx create-payload-api-docs --config=src/payload.config.ts from a PayloadCMS directory, I encountered the following error related to the SWC transpiler:

thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_transforms_module-0.180.13/src/path.rs:122:13:
base_dir(``) must be absolute. Please ensure that `jsc.baseUrl` is specified correctly...

By adding a simple .swrc file, it seems to start working, but there is no mention of this in the documentation:

{
  "$schema": "https://json.schemastore.org/swcrc",
  "jsc": {
    "baseUrl": "./",
  },
  "module": {
    "type": "es6"
  }
}

After getting passed this, I think recieve other errors in the terminal:

[09:54:29] ERROR (payload): There were 4 errors validating your Payload config
[09:54:29] ERROR (payload): 1: "editor" is not allowed
[09:54:29] ERROR (payload): 2: "db" is not allowed
[09:54:29] ERROR (payload): 3: Collection "payload-migrations" > "graphQL" must be of type object
[09:54:29] ERROR (payload): 4: Collection "payload-migrations" > "endpoints" must be an array

Thanks in advance.

What did you expect

No issue, it generates the docs.

Setps to reproduce

Create a blank application in Payload and add a simple content type, run the commands indicated above.

Tool version

Latest

Payload version

2.0.0

Node version

v18.11.0

@ainsleyclark ainsleyclark added the bug Something isn't working label Mar 9, 2024
@ainsleyclark
Copy link
Author

Any idea on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants