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

Prisma2 dev 'cannot destructure property "dmmf"' #999

Closed
BiscuiTech opened this issue Nov 26, 2019 · 15 comments
Closed

Prisma2 dev 'cannot destructure property "dmmf"' #999

BiscuiTech opened this issue Nov 26, 2019 · 15 comments
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before.
Milestone

Comments

@BiscuiTech
Copy link

BiscuiTech commented Nov 26, 2019

I am recently having this issue where running prisma2 dev seems to work fine. The interface at lh/5555 loads up but shows "getting things ready" for about 5 minutes. Then, this error happens:
image

In the console, i get this:
Failed to generate Photon client: Error: Error: Command failed with ENOENT: /home/biscuitech/.nvm/versions/node/v13.1.0/lib/node_modules/prisma2/query-engine-linux-glibc-libssl1.1.0 cli --dmmf spawn /home/biscuitech/.nvm/versions/node/v13.1.0/lib/node_modules/prisma2/query-engine-linux-glibc-libssl1.1.0 ENOENT
I can't seems to make prisma2 dev work.

Before trying prisma2 dev, I ran prisma2 lift save & up with sucess. But after running prisma2 dev, I have this error on lift up:
https://gist.github.com/BiscuiTech/4fc7058b55379ed6fec13c2f6f8f107c

After trying prisma2 dev again, it crashes right away with this error:

image

@BiscuiTech
Copy link
Author

BiscuiTech commented Nov 26, 2019

The stack trace (of the Gist) seems to correspond to the same trace as this error #919.

@ghost
Copy link

ghost commented Nov 26, 2019

Hi. This is the same error (Command failed with ENOENT [...] query-engine-linux-glibc-libssl1.1.0 cli --dmmf [...]) that I reported here: #993. I'm seeing your exact same error in the web interface at localhost:5555, but I don't have to wait minutes to receive the error, it's almost instantaneous.

@pantharshit00
Copy link
Contributor

pantharshit00 commented Nov 27, 2019

Can you please all try this again with the latest preview(preview017)? The binary names that you have mentioned are referring to the old names so I think you are using an old version of Prisma 2.

If you on Linux, please use this command to install prisma2(if you don't have nvm or similar tool or haven't set the permission of npm global bin properly):

sudo npm install -g --unsafe-perm prisma2

@pantharshit00 pantharshit00 added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. labels Nov 27, 2019
@pantharshit00
Copy link
Contributor

Update: I am able to reproduce this on windows with the latest alpha: prisma2@2.0.0-alpha.360, binary version: 6159bf3

image

I will check on mac as well with the latest alpha.

@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. labels Nov 27, 2019
@pantharshit00
Copy link
Contributor

I am unable to reproduce this on mac though

@tmfprlt1234
Copy link

tmfprlt1234 commented Nov 27, 2019

Update: I am able to reproduce this on windows with the latest alpha: prisma2@2.0.0-alpha.360, binary version: 6159bf3

image

I will check on mac as well with the latest alpha.

i also installed prisma2@alpha, but not changed, at vmware - centos 7, postgres

@kripod
Copy link
Contributor

kripod commented Nov 27, 2019

I just encountered this while running yarn prisma2 dev on Windows 10 x64. The stack trace could hardly be caught, due to the interactive behavior of prisma2 dev constantly rewriting the entire screen.

image

The issue can be reproduced by cloning this repo, installing the dependencies and then running yarn generate in the server directory, followed by yarn develop or more specifically, yarn prisma2 develop.

@pantharshit00 pantharshit00 added kind/regression A reported bug in functionality that used to work before. process/candidate and removed kind/bug A reported bug. labels Nov 27, 2019
@BiscuiTech
Copy link
Author

BiscuiTech commented Nov 27, 2019

Can you please all try this again with the latest preview(preview017)? The binary names that you have mentioned are referring to the old names so I think you are using an old version of Prisma 2.

If you on Linux, please use this command to install prisma2(if you don't have nvm or similar tool or haven't set the permission of npm global bin properly):

sudo npm install -g --unsafe-perm prisma2

I do have nvm. I'm on Win10 running 20H1 and WSL2. I'll try cleaning the whole npm cache and reinstalling everything.

EDIT:
So I reinstalled node & npm, cleaned the cache and reinstall using unsafe-perms:
image

EDIT 2:
I tried specifying the platform in the schema.prisma file like so:
image

But the error persists. I checked the folder where the binary engine resides and it's not there:
image

@CaptainChemist
Copy link

CaptainChemist commented Nov 27, 2019

I'm having this exact issue when trying to run within a docker environment. Here's a repo, it is the prisma2 hello starter where I added a Dockerfile and docker-compose.yml. In this case, I'm using npx as well as prisma v17.1 and photon v17.1 packages added to the package.json

https://github.com/CaptainChemist/prisma2-17.1-enoent-err

If you download the project and then run docker-compose build followed by docker-compose up the backend and studio containers both have the query-engine-debian-openssl-1.1.x file. For completeness, in order to get into those containers you have to run one of the following from the command line after you do a docker-compose up:
docker exec -it backend bash
docker exec -it studio bash

The problem is that when I run prisma2 dev that the docker-compose output has an error: Failed to generate Photon client: Error: Error: Command failed with ENOENT: /app/node_modules/prisma2/query-engine-linux-glibc-libssl1.1.0 cli --dmmf

I'm not sure why that is looking for a different query engine. In any case, hopefully running in a docker container will allow people on different platforms to have the same environment, but that's interesting that people are seeing the same issue outside of debian docker instances.

Update- I get the same behavior when I install prisma2 globally and when I install prisma2 locally and use npx.

@pantharshit00 I see the same behavior that you were seeing where this works great on my mac when I'm outside the docker environment.

@pantharshit00
Copy link
Contributor

I can confirm this on linux, see #993 (comment)

@timsuchanek
Copy link
Contributor

Thanks a lot for your input everyone! We just released a new alpha, which should fix this issue in the prisma2 dev command.
Please let me know, how it goes for you :)

@tmfprlt1234
Copy link

tmfprlt1234 commented Nov 28, 2019

i updated new to new alpha, so i cant see this issue anymore.
but when i open localhost:5555 in my browser(chrome,ie) it seems like this ->
image

image

image

@timsuchanek
Copy link
Contributor

Thanks @tmfprlt1234! The big plus should be gone now in the latest alpha (369).
We'll do a patch release now including a fix for this!
Let me know if it's still an issue for you and I'll reopen this issue.

@BiscuiTech
Copy link
Author

I just updated and it seems that the original issue was fixed. But now I have this issue on my localhost db connection:
image

It comes from a "failedCalculatedSteps" file the prisma framework generated on the error.

@janpio
Copy link
Member

janpio commented Nov 28, 2019

@BiscuiTech Please open a new issue and someone will take a look into reproducing this. Thanks.

@janpio janpio added this to the Preview 18 milestone Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/regression A reported bug in functionality that used to work before.
Projects
None yet
Development

No branches or pull requests

7 participants