keystone
keystone copied to clipboard
@latest GeneratorError while generating prisma schemas
Bug report
Updated to @latest version and tried to run the project resolving in this error. (win10 + VS Code)
Describe the bug
when running keystone-next dev it fails with the following error
> keystone-next dev
✨ Starting Keystone
⭐️ Dev Server Ready on http://localhost:4000
✨ Generating GraphQL and Prisma schemas
GeneratorError: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
at validateString (internal/validators.js:124:11)
at Object.dirname (path.js:583:5)
at Object.generateClient (%node_modules%\@prisma\client\generator-build\index.js:73493:80)
at Object.onGenerate (%node_modules%\@prisma\client\generator-build\index.js:78783:34)
at LineStream.<anonymous> (%node_modules%\@prisma\client\generator-build\index.js:2800:40)
at LineStream.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at LineStream.Readable.push (internal/streams/readable.js:223:10)
at LineStream.Transform.push (internal/streams/transform.js:166:32)
at GeneratorProcess.handleResponse (%project-path%\backend\node_modules\@keystone-next\keystone\node_modules\@prisma\generator-helper\src\GeneratorProcess.ts:132:25)
at LineStream.<anonymous> (%project-path%\backend\node_modules\@keystone-next\keystone\node_modules\@prisma\generator-helper\src\GeneratorProcess.ts:105:18)
at LineStream.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at LineStream.Readable.push (internal/streams/readable.js:223:10)
at LineStream.Transform.push (internal/streams/transform.js:166:32)
at LineStream._pushBuffer (%project-path%\backend\node_modules\@keystone-next\keystone\node_modules\@prisma\generator-helper\src\byline.ts:119:17)
at LineStream._transform (%project-path%\backend\node_modules\@keystone-next\keystone\node_modules\@prisma\generator-helper\src\byline.ts:110:8)
at LineStream.Transform._read (internal/streams/transform.js:205:10) {
code: -32000,
data: null
}
To Reproduce
upgrade dependencies to the following:
"dependencies": {
"@keystone-next/admin-ui": "^14.0.0",
"@keystone-next/auth": "^21.0.0",
"@keystone-next/fields": "^7.0.0",
"@keystone-next/keystone": "^16.0.0",
"dotenv": "^8.2.0",
"next": "^10.1.3",
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
Unknown if it is upgrading an existing db project will cause the issue or if it happens with a fresh project.
Expected behaviour
I expect the project to build and run
Screenshots
System information
- Windows 10
- VS Code
Additional context
I got this too, had to revert back to a previous version
Hi @perlohmann, thanks for raising this issue and also surfacing it on Slack (https://keystonejs.slack.com/archives/C01STDMEW3S/p1619072873324100).
If anyone else is experiencing this issue, could you please delete your node_modules folder, your lock file (package-lock.json or yarn.lock file) and your .keystone folder and install your dependencies.
Please let us know if you continue to have issues!
@bladey I tried that and still the same error. Even tried removing the schema.graphql and schema.prisma files. postinstall also fails with the same error.
Further update ... seems to be a Yarn issue... using NPM solves it
Thanks @ashhitch.
Related Slack discussion - https://keystonejs.slack.com/archives/C01STDMEW3S/p1619073144326000
Further update ... seems to be a Yarn issue... using NPM solves it
Yes, can confirm switching to npm fixed it for me too. It breaks every time I run yarn install and npm i fixes it.
It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :)
Marked as stale, if anyone can reproduce this problem, please comment or open a new issue