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

TypeError: The "to" argument must be of type string. Received an instance of Object. Code: ERR_INVALID_ARG_TYPE #332

Closed
eunchurn opened this issue May 19, 2024 · 3 comments

Comments

@eunchurn
Copy link

Steps of reproduce

  1. Installation by using @paljs/cli create
npx @paljs/cli create

image

yarn install
  1. Generating
image
yarn run v1.22.22
$ pal g && npm -s run generate:prisma && npm -s run generate:nexus
    TypeError: The "to" argument must be of type string. Received an instance of Object
    Code: ERR_INVALID_ARG_TYPE
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What did I do wrong?

Tested Node Versions: v22.2.0, v20.13.1

@eunchurn
Copy link
Author

eunchurn commented May 29, 2024

log.d(chalk.dim(`Prisma Schema loaded from ${relative(process.cwd(), schemaPath)}`));

I found the cause. The schemaPath is nested in the form of schemaPath.schemaPath here. The nested schemaPath.schemaPath appears as an absolute path. Therefore, the issue arises because path.relative() receives to in an object format. Consequently, on line 8, you need to change const schemaPath = await getSchemaPath0(path); to const { schemaPath } = await getSchemaPath0(path);.

@eunchurn
Copy link
Author

The above issue appears to stem from the @prisma/internals version. It seems that fixing the @prisma/internals package to version 5.2.0 instead of using ^5.2.0 will resolve this issue.

if you are using pnpm, add package.json as follow

{
  "pnpm": {
    "overrides": {
      "@prisma/internals": "5.2.0"
    }
  }
}

@AhmedElywa
Copy link
Collaborator

Fixed in the last version, We upgraded the Prisma version to 5.14

@eunchurn eunchurn closed this as completed Jun 2, 2024
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

No branches or pull requests

2 participants