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
Error generating the Prisma client #404
Comments
@AndrewSverdrup thank you for reporting this. And sorry you ran into issues right out of the gate. I used the .zip you included to test locally. I was unable to reproduce the error (yay/boo). If you are still experiencing this, could you try the following:
🤞😬 |
Followed your steps and got the same result @thedavidprice Removed global prisma CLI just to be sure. Also, now created an entirely new project with instructions form https://redwoodjs.com/tutorial/installation-starting-development
Same error as printed above :/ Full log
|
@turbotobias Thank you for this and I’ll dig in. The current Redwood release uses Prisma preview.025. We have Prisma beta.2 working in our ‘master’ but yet to be released — my current working theory is that the fix is in there. re: Global Prisma install: Ah, this could definitely be part of the issue. Did you install globally prior to trying out Redwood? Or in attempt to get things working with Redwood? |
Looking forward to the release :) Yes, most likely I had the Prisma2 CLI (alpha version) installed prior to trying out Redwood the first time. But same result after uninstalling |
@thedavidprice I can also still reproduce the issue following the steps you listed. I also had the Prisma2 CLI installed globally before trying out Redwood, so it sounds like that may be the issue. I tried uninstalling the CLI, but it doesn't fix the issue. Also I'm on a Mac, not sure if that makes a difference.
Me too! |
Could you run the following and let us know if it generates the client, and migrates the database?
This is equivalent to what is run when you type |
|
Same error for Tried Output
|
@turbotobias Crazy, could you check that your https://github.com/redwoodjs/create-redwood-app/blob/master/.env.defaults#L7 |
Yup, file matches exactly
|
Thanks, this gives me an idea! I'll get back to you soon |
Just out of curiosity, how is |
Check ~/Downloads/redwoodblog The package is installed here: redwood/packages/core/package.json Line 20 in 607e481
|
@turbotobias So I actually forgot how the redwood/packages/cli/src/index.js Lines 8 to 12 in db1dbbe
and then passes them in scope to the executed CLI: redwood/packages/cli/src/lib/index.js Line 196 in 8d510db
Could you just run |
Yes,
|
Hi @turbotobias, See this issue: prisma/prisma#1973 |
The “space in path” issue above is very helpful. But this doesn’t seem to be the case for the OP @AndrewSverdrup (make sure to click the details hide/reveal): #404 (comment) There are a couple other data points for diagnosing:
We have a As of now, I think 2/3 of the reported errors will resolve once we release new Redwood packages that include the latest Prisma beta. (Hopefully this Monday 🤞 ) |
Early on I looked at that issue and thought "I don't have spaces in my paths"... 🤦 But totally forgot that the Mac OS 10.15.* update raped my filesystem. It put common folders like Documents and similar undeneath this new "Mobile Documents" folder which is iCloud. So possible that others on recent Mac OS versions may experience the same. Anyways, now the client is generated and everything is working (using another path without spaces) ✅ Thanks! 🙏 |
The space in the path was my issue too. I didn't realize that could be the cause of the issue and I sort of "sanitized" the path in the output logs I posted since the path to my project was fairly long. Never thought that'd be the issue 🤦. Thanks for the fix and I've learned not to modify the output log at all (seems obvious now 😅). |
That is so funny that you made the path pretty. I did exactly the same in my first log reply, thankfully I added more without modifying. Never again! |
Looks like a fix is now merged into prisma/cli@alpha and will be in next Beta release: |
This was reported earlier on Windows. Linking to test as well once next Prisma release is out and in RWJS: #409 |
@InquisitiveAboutReact We fairly recently decided to tighten up our node requirement. We only run tests on node 14.x, so we decided that was the only version we wanted to officially support. If our docs still say >= 12 somewhere, they need to be updated. Do you by chance still remember where you read node 12? If you want to continue using RW on node 12 you have to manually change the "engines" config in the root |
Hi @Tobbe - Thanks for your reply. To answer your question 'Do you by chance still remember where you read node 12? ' -- Today is my first day exploring RW and went through the below URL. In Video 1 , it says Yarn > 1.15.x and Node > 12.x Last but not the least, while creating the RW app , using yarn create redwood-app ./appname , I am getting the below message .. The app folder gets created and while I was trying to run yarn redwood dev or yarn rw dev it says it couldn't find the command 'redwood' / 'rw' . Sorry for too many questions, I must be missing something I guess :) |
Hi @Tobbe - Somehow able to fix the issue. Below are the steps I did
|
You only had to do that because it failed in the first step. For someone who already had the required version of node RW will be installed automatically |
Ahh, I see. |
I will do the same. Thanks for your reply @Tobbe . One more query though. Getting the below error, any suggestion for a quick fix for the same? It's related to Prisma. |
@Tobbe I think is is in the Quick Start https://redwoodjs.com/docs/quick-start Have added a documentation issue: https://github.com/redwoodjs/redwoodjs.com/issues/717 |
I'm afraid I haven't seen that one before 🙁 Could you please try upgrading to node 14 if you haven't already? See if that helps BTW, what shell and terminal are you using? |
Hi @Tobbe - I am using command prompt and Node js command prompt. There's one solution provided in the below Github link but looks like it's old. I tried to search ../node_modules/prisma2 folder but didn't get it. Oh, the system currently I am working on, it's a bit old so don't support N v 14. Thought I'd try with N v 13.x but haven't started yet. If you somehow managed to find the solution, please do let me know. |
Can you please post the output from |
I was hoping to get the full output, to see your Windows version as well Here's mine
|
Hi @Tobbe - Here's the full log. This system of mine is kinda old where I am trying to work on RW. It's Win 7. |
Yeah, sorry, if things works on something that old it's more of a happy coincidence than something we have the resources to actively support. But, if there's some easy change we can do to make it work for you, we're happy to fix it 🙂 Just let us know 👍 |
Hi @Tobbe - Thanks a lot for your help till now. Really appreciate :) |
@InquisitiveAboutReact Is it 32 or 64 bit Win7? I just found this prisma/prisma#6771 |
@Tobbe -Thanks, went through the thread. It's for query-engine and Microsoft has ended the support for W7. When I try to install prisma/cli , prisma/client locally / globally, I am not having any issues. When redwood is trying to run prisma client, I am getting error, so I believe it might be something related to configuration related to Redwood + Prisma for Win7. Don't think it's an isolated incident only related to prisma. What's your take on this? I think, I should post this issue in prisma github forum as well. |
Exactly! I remembered seeing query-engine-windows.exe in your screenshot. And since you're on Win7 I thought it might be relevant to you :) You can ask the Prisma people, but I think they're just going to tell you the same thing as the dude in that issue I linked - Win7 is not supported. |
Yes I saw that and you did catch it perfectly @Tobbe :) Posted that issue in Prisma forum. Let's see. Doing manual configuration for Win 7 will be hectic still will try once if needed. Let's hope for the best ! |
They have requested to log this as a bug . Below is the link |
I am following the tutorial here https://redwoodjs.com/tutorial/installation-starting-development, and am running into an error. Here are my project files (just the generated starter files minus the node_modules folder) and the commands I've run:
Project zip: redwoodblog.zip
Error Output:
yarn rw dev
Click details below to view.
yarn run v1.22.4
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/rw' dev
✖ Generating the Prisma client...
→ info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Command failed with exit code 1: yarn prisma2 generate
Error: Cannot call write after a stream was destroyed
error Command failed with exit code 1.
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2' generate
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server'
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/webpack-dev-server' --config ../node_modules/@redwoodjs/core/config/webpack.development.js
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2' generate --watch
21:39:28 db | Error: Cannot call write after a stream was destroyed
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:28 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1
21:39:28 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch restarted
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2' generate --watch
21:39:30 db | Error: Cannot call write after a stream was destroyed
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:30 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1
21:39:30 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch restarted
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2' generate --watch
21:39:30 web | ℹ 「wds」: Project is running at http://localhost:8910/
21:39:30 web | ℹ 「wds」: webpack output is served from /
21:39:30 web | ℹ 「wds」: Content not from webpack is served from /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/web
21:39:30 web | ℹ 「wds」: 404s will fallback to /index.html
21:39:33 db | Error: Cannot call write after a stream was destroyed
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:33 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1
21:39:33 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch restarted
21:39:33 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3
21:39:33 api | throw new Error(
21:39:33 api | ^
21:39:33 api |
21:39:33 api | Error: @prisma/client did not initialize yet. Please run "prisma2 generate" and try to import it again.
21:39:33 api | In case this error is unexpected for you, please report it in prisma/prisma-client-js#390.
21:39:33 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11)
21:39:33 api | at Object. (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19)
21:39:33 api | at Module._compile (internal/modules/cjs/loader.js:1147:30)
21:39:33 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24)
21:39:33 api | at Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
21:39:33 api | at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7)
21:39:33 api | at Module.load (internal/modules/cjs/loader.js:996:32)
21:39:33 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14)
21:39:33 api | at Module.require (internal/modules/cjs/loader.js:1036:19)
21:39:33 api | at require (internal/modules/cjs/helpers.js:72:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:33 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1
21:39:33 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server restarted
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/prisma2' generate --watch
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server'
21:39:35 db | Error: Cannot call write after a stream was destroyed
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:35 db | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn prisma2 generate --watch exited with code 1
21:39:37 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3
21:39:37 api | throw new Error(
21:39:37 api | ^
21:39:37 api |
21:39:37 api | Error: @prisma/client did not initialize yet. Please run "prisma2 generate" and try to import it again.
21:39:37 api | In case this error is unexpected for you, please report it in prisma/prisma-client-js#390.
21:39:37 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11)
21:39:37 api | at Object. (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19)
21:39:37 api | at Module._compile (internal/modules/cjs/loader.js:1147:30)
21:39:37 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24)
21:39:37 api | at Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
21:39:37 api | at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7)
21:39:37 api | at Module.load (internal/modules/cjs/loader.js:996:32)
21:39:37 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14)
21:39:37 api | at Module.require (internal/modules/cjs/loader.js:1036:19)
21:39:37 api | at require (internal/modules/cjs/helpers.js:72:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:38 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1
21:39:38 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server restarted
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server'
21:39:43 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3
21:39:43 api | throw new Error(
21:39:43 api | ^
21:39:43 api |
21:39:43 api | Error: @prisma/client did not initialize yet. Please run "prisma2 generate" and try to import it again.
21:39:43 api | In case this error is unexpected for you, please report it in prisma/prisma-client-js#390.
21:39:43 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11)
21:39:43 api | at Object. (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19)
21:39:43 api | at Module._compile (internal/modules/cjs/loader.js:1147:30)
21:39:43 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24)
21:39:43 api | at Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7)
21:39:43 api | at Module.load (internal/modules/cjs/loader.js:996:32)
21:39:43 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14)
21:39:43 api | at Module.require (internal/modules/cjs/loader.js:1036:19)
21:39:43 api | at require (internal/modules/cjs/helpers.js:72:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:43 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1
21:39:43 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server restarted
$ '/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/.bin/dev-server'
21:39:49 api | /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3
21:39:49 api | throw new Error(
21:39:49 api | ^
21:39:49 api |
21:39:49 api | Error: @prisma/client did not initialize yet. Please run "prisma2 generate" and try to import it again.
21:39:49 api | In case this error is unexpected for you, please report it in prisma/prisma-client-js#390.
21:39:49 api | at new PrismaClient (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/@prisma/client/index.js:3:11)
21:39:49 api | at Object. (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api/src/lib/db.js:6:19)
21:39:49 api | at Module._compile (internal/modules/cjs/loader.js:1147:30)
21:39:49 api | at Module._compile (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:99:24)
21:39:49 api | at Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
21:39:49 api | at Object.newLoader [as .js] (/Users/Andrew/RedwoodJS_Tutorial/redwoodblog/node_modules/pirates/lib/index.js:104:7)
21:39:49 api | at Module.load (internal/modules/cjs/loader.js:996:32)
21:39:49 api | at Function.Module._load (internal/modules/cjs/loader.js:896:14)
21:39:49 api | at Module.require (internal/modules/cjs/loader.js:1036:19)
21:39:49 api | at require (internal/modules/cjs/helpers.js:72:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
21:39:49 api | cd /Users/Andrew/RedwoodJS_Tutorial/redwoodblog/api && yarn dev-server exited with code 1
The text was updated successfully, but these errors were encountered: