Blitz: yarn command fails on node-v14

Created on 27 May 2020  ยท  4Comments  ยท  Source: blitz-js/blitz

What is the problem?

When i try to run yarn test on node version 14.1.0. it exits the process with some error message.

Screenshot 2020-05-27 at 8 10 24 PM

Steps to Reproduce

  1. try to run yarn test on Node version 14.1.0
needs more information statudone

Most helpful comment

I have a similar, but probably unrelated to the issue experienced by @ganeshmani.

I was trying to deploy my blitz app on a fresh Ubuntu 18.04 but with Node 14 I would get a myriad of these issues:

  1. On blitz build I could not export types from the db object, which was essentially just const db = new PrismaClient()
  2. I removed all exported types used in my code and the build went fine, but when I served the app, the app could crash, because there was no instance of PrismaClient.
  3. If I ran blitz db migrate I would get Everything up-to-date, but when I inspected the postgres db via psql, no tables were created except _Migration. This table was also empty.
                   List of relations
 Schema |          Name           |   Type   |  Owner
--------+-------------------------+----------+----------
 public | _Migration              | table    | postgres

I realised later that Everything up-to-date is the output from prisma migrate save command, the output from blitz after that should be like:

.....

Everything up-to-date

๐Ÿ‹๏ธโ€  migrate up
.....

  1. If I installed @prisma/cli and ran prisma migrate save it would work, but if I ran prisma migrate up, I would get the error that the DATABASE_URL environment variable was not defined. The error would be the same, whether or not I used an .env file or declared the connection string directly in schema.prisma. The only thing that worked was it I did this:
$ DATABASE_ENV=postgresql://postgres:password@localhost:5432/db prisma migrate up`

I would run all prisma commands with --experimental --create-db --schema schema.prisma

I saw this issue and tried afresh with Node 12 instead, and magically, everything went fine.

These might be unique to my project, but if I have time I will see if I can recreate on a fresh blitz project.

All 4 comments

Hey @ganeshmani thanks for submitting this issue! ๐Ÿ™Œ

I'm having trouble reproducing this error. I am able to run yarn test without issue using node v14.1.0. Can you make sure that you are following the instructions in CONTRIBUTING.MD and post a more detailed description of how to reproduce? Thanks!

I couldn't reproduce it either. It'd be great to get more information ๐Ÿ˜ƒ

I have a similar, but probably unrelated to the issue experienced by @ganeshmani.

I was trying to deploy my blitz app on a fresh Ubuntu 18.04 but with Node 14 I would get a myriad of these issues:

  1. On blitz build I could not export types from the db object, which was essentially just const db = new PrismaClient()
  2. I removed all exported types used in my code and the build went fine, but when I served the app, the app could crash, because there was no instance of PrismaClient.
  3. If I ran blitz db migrate I would get Everything up-to-date, but when I inspected the postgres db via psql, no tables were created except _Migration. This table was also empty.
                   List of relations
 Schema |          Name           |   Type   |  Owner
--------+-------------------------+----------+----------
 public | _Migration              | table    | postgres

I realised later that Everything up-to-date is the output from prisma migrate save command, the output from blitz after that should be like:

.....

Everything up-to-date

๐Ÿ‹๏ธโ€  migrate up
.....

  1. If I installed @prisma/cli and ran prisma migrate save it would work, but if I ran prisma migrate up, I would get the error that the DATABASE_URL environment variable was not defined. The error would be the same, whether or not I used an .env file or declared the connection string directly in schema.prisma. The only thing that worked was it I did this:
$ DATABASE_ENV=postgresql://postgres:password@localhost:5432/db prisma migrate up`

I would run all prisma commands with --experimental --create-db --schema schema.prisma

I saw this issue and tried afresh with Node 12 instead, and magically, everything went fine.

These might be unique to my project, but if I have time I will see if I can recreate on a fresh blitz project.

Sorry, I was viewing github on my phone and accidentaly move this issue

Was this page helpful?
0 / 5 - 0 ratings