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

npx prisma studio fails to start up on the browser #666

Closed
Toyz opened this issue Apr 28, 2021 · 6 comments
Closed

npx prisma studio fails to start up on the browser #666

Toyz opened this issue Apr 28, 2021 · 6 comments
Assignees
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Milestone

Comments

@Toyz
Copy link

Toyz commented Apr 28, 2021

  1. Prisma version (prisma -v or npx prisma -v):
{
  "prisma": "2.21.2",
  "@prisma/client": "2.21.2",
  "current-platform": "darwin",
  "query-engine": "query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/query-engine-darwin)",
  "migration-engine": "migration-engine-cli e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/migration-engine-darwin)",
  "introspection-engine": "introspection-core e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/introspection-engine-darwin)",
  "format-binary": "prisma-fmt e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/prisma-fmt-darwin)",
  "default-engines-hash": "e421996c87d5f3c8f7eeadd502d4ad402c89464d",
  "studio": "0.371.0"
}
  1. Logs from Developer Tools Console or Command line, if any:
GET http://localhost:3000/@vite/client net::ERR_ABORTED 404 (Not Found)
(index):29 GET http://localhost:3000/src/index.tsx net::ERR_ABORTED 404 (Not Found)
(index):25 GET http://localhost:3000/@react-refresh net::ERR_ABORTED 404 (Not Found)
(index):30 Uncaught ReferenceError: PrismaStudio is not defined
    at (index):30
@Toyz
Copy link
Author

Toyz commented Apr 28, 2021

It feels like there is a missing dep when using npx prisma studio

@sdnts
Copy link
Contributor

sdnts commented Apr 28, 2021

@Toyz Thanks for reporting this! This is super weird, it looks like somehow Studio is trying to load its "development" server (aka the server I use while building Studio; hence the Vite stuff)

I'm unfortunately not able to see this on 2.21.2. Do you by any chance have NODE_ENV set to development on your shell? Maybe an export NODE_ENV=development you forgot about? echo $NODE_ENV should let you know if that's the case. Let me know if that isn't set and you're still seeing this!

@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 Apr 28, 2021
@Toyz
Copy link
Author

Toyz commented Apr 28, 2021

I just did NODE_ENV=production yarn prisma studio and it fixed it so it seems it was just he NODE_ENV i should of checked that before reporting this bug!

@myfreax
Copy link

myfreax commented May 2, 2021

@Toyz Thanks your anwser

myfreax added a commit to myfreax/nest-starter that referenced this issue May 2, 2021
@sdnts sdnts added the bug/2-confirmed Bug has been reproduced and confirmed. label May 8, 2021
@sdnts sdnts self-assigned this May 8, 2021
@sdnts
Copy link
Contributor

sdnts commented May 8, 2021

Hey everyone, I've made changes on the latest dev version of prisma so that Studio doesn't go into "development mode" when NODE_ENV is set incorrectly. NODE_ENV is such a common env var that I think it would have been really annoying if Studio depended on it too.

@Toyz if you could try this dev version out with your setup and let me know if all's good, that'd be great!

I'd also recommend upgrading to the latest stable version of prisma when it comes out rather than sticking to the dev version, since it occasionally contains unannonuced breaking changes.

@sdnts sdnts closed this as completed May 8, 2021
@sdnts sdnts added this to the 2.23.0 milestone May 8, 2021
@Toyz
Copy link
Author

Toyz commented May 8, 2021 via email

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. bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

3 participants