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

Not working in VSCode (docker) devcontainer #687

Closed
sachinraja opened this issue May 19, 2021 · 2 comments
Closed

Not working in VSCode (docker) devcontainer #687

sachinraja opened this issue May 19, 2021 · 2 comments
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug.
Milestone

Comments

@sachinraja
Copy link

sachinraja commented May 19, 2021

  1. Prisma version (prisma -v or npx prisma -v):
prisma               : 2.22.1
@prisma/client       : 2.22.1
Current platform     : debian-openssl-1.1.x
Query Engine         : query-engine 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/@prisma/engines/query-engine-debian-openssl-1.1.x)
Migration Engine     : migration-engine-cli 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary        : prisma-fmt 60cc71d884972ab4e897f0277c4b84383dddaf6c (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : 60cc71d884972ab4e897f0277c4b84383dddaf6c
Studio               : 0.379.0
  1. Logs from Developer Tools Console:
localhost/:29 GET http://localhost:3000/@vite/client net::ERR_SOCKET_NOT_CONNECTED
localhost/:29 GET http://localhost:3000/src/index.tsx net::ERR_SOCKET_NOT_CONNECTED
(index):25 GET http://localhost:3000/@react-refresh net::ERR_CONNECTION_RESET
(index):30 Uncaught ReferenceError: PrismaStudio is not defined
    at (index):30
(anonymous) @ (index):30
load (async)
(anonymous) @ (index):29
:3000/favicon.svg:1 GET http://localhost:3000/favicon.svg net::ERR_CONNECTION_RESET

I'm running npx prisma studio in a VSCode devcontainer. It automatically forwards the port 5555 and the URL opens in Chrome. I've tried statically forwarding the port (by specifying it in my docker configuration), but that doesn't work either. I just receive the above error in console. The page does not load at all, it is completely blank. The terminal console does not log any errors, it just says Prisma Studio is up on http://localhost:5555.

@sachinraja sachinraja changed the title How to use in VSCode (docker) devcontainer Not working in VSCode (docker) devcontainer May 19, 2021
@sdnts
Copy link
Contributor

sdnts commented May 19, 2021

Hey @cloudagon, from your logs it looks like Studio thinks it is in development mode (hence the Vite stuff). I’m guessing your setup sets the NODE_ENV environment variable (like on this issue: #666).

I’ve since made it so Studio no longer depends on the NODE_ENV env var, so this shouldn’t happen anymore.

You can get the fix by installing prisma@dev (So the dev version). Although I’d recommend just waiting a few more hours, since prisma 2.23.0 is set to be released soon, and that’ll include it as well.

Let me know if you still see this after 2.23!

In the mean time I think you can also use the workaround posted on that issue!

@sdnts sdnts 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 May 19, 2021
@sdnts sdnts added this to the 2.24.0 milestone May 19, 2021
@sachinraja
Copy link
Author

sachinraja commented May 19, 2021

Thanks for the quick response, it worked on prisma@dev! Running NODE_ENV=production npx prisma studio (the suggested workaround in the issue) also worked on Prisma 2.22.1.

@sdnts sdnts closed this as completed May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

2 participants