Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Prisma and node 12.19.0 #907

Closed
divyenduz opened this issue Oct 7, 2020 · 8 comments
Closed

Prisma and node 12.19.0 #907

divyenduz opened this issue Oct 7, 2020 · 8 comments
Assignees
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. tech/typescript Issue for tech TypeScript.
Milestone

Comments

@divyenduz
Copy link

divyenduz commented Oct 7, 2020

Bug description

Prisma (latest dev, 2.8.0, 2.8.1, 2.7.0 versions) with node 12.19.0 results in the following error:

2020-10-07T12:57:03.018176+00:00 app[web.1]: node[4]: ../src/node_http_parser_impl.h:529:static void node::{anonymous}::Parser::Initialize(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[3]->IsInt32()' failed.
2020-10-07T12:57:03.023285+00:00 app[web.1]: 1: 0xa17c40 node::Abort() [node]
2020-10-07T12:57:03.024000+00:00 app[web.1]: 2: 0xa17cbe  [node]
2020-10-07T12:57:03.024670+00:00 app[web.1]: 3: 0xa3214a  [node]
2020-10-07T12:57:03.025326+00:00 app[web.1]: 4: 0xc019e9  [node]
2020-10-07T12:57:03.027280+00:00 app[web.1]: 5: 0xc037d7 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]

How to reproduce

  1. git clone https://github.com/divyenduz/prisma-client-js-907 p2-node-12
  2. cd p2-node-12
  3. Setup node 12.19.0 in the environment
  4. Add Postgres DB_URL to prisma/.env (ping Divy, if needed)
  5. node index.js
  6. Invoke the URL (http://localhost:3000), it should fail

The error mentioned above should be visible in the logs.

Expected behavior

Prisma and node 12.19.0 should work.

@divyenduz divyenduz added bug/1-repro-available A reproduction exists and needs to be confirmed. kind/bug A reported bug. team/support-engineering Issue for team Support Engineering. labels Oct 7, 2020
@pantharshit00

This comment has been minimized.

@divyenduz divyenduz added bug/2-confirmed We have confirmed that this is a bug. and removed bug/1-repro-available A reproduction exists and needs to be confirmed. labels Oct 7, 2020
@divyenduz divyenduz changed the title Prisma and Heroku deployment Prisma and Heroku (node 12) deployment Oct 7, 2020
@divyenduz divyenduz changed the title Prisma and Heroku (node 12) deployment Prisma and node 12.19.0 Oct 7, 2020
@pantharshit00
Copy link
Contributor

pantharshit00 commented Oct 7, 2020

Looks like node 12.19.0 broke something here. We are able to reproduce this locally with node version v12.19.0 while it is working fine with node version 12.18.4.

image

We will need to report this to node.js I think.

🚀 Server ready at: http://localhost:3000
⭐️ See sample requests: http://pris.ly/e/ts/rest-express#3-using-the-rest-api
node[17950]: ../src/node_http_parser_impl.h:529:static void node::(anonymous namespace)::Parser::Initialize(const FunctionCallbackInfo<v8::Value> &): Assertion `args[3]->IsInt32()' failed.
 1: 0x1011f40c5 node::Abort() (.cold.1) [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 2: 0x1000a5749 node::Abort() [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 3: 0x1000a55b1 node::Assert(node::AssertionInfo const&) [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 4: 0x1000c6e1b node::(anonymous namespace)::Parser::Initialize(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 5: 0x100259838 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 6: 0x100258df9 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 7: 0x100258562 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 8: 0x100a02b19 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
 9: 0x1009882a4 Builtins_InterpreterEntryTrampoline [/Users/harshit/.nvm/versions/node/v12.19.0/bin/node]
[1]    17950 abort      node src/index.js

@pantharshit00
Copy link
Contributor

Undici issue for this: nodejs/undici#448

@Jolg42

This comment has been minimized.

@Jolg42 Jolg42 closed this as completed Oct 8, 2020
@Jolg42 Jolg42 added this to the Release 2.9.0 milestone Oct 8, 2020
@Jolg42 Jolg42 self-assigned this Oct 8, 2020
@Jolg42 Jolg42 reopened this Oct 8, 2020
@Jolg42
Copy link
Contributor

Jolg42 commented Oct 8, 2020

Current workaround until a fix is found and released in next Prisma release is to pin your Node.js version to a previous version of Node (<12.9.0).

@Jolg42
Copy link
Contributor

Jolg42 commented Oct 9, 2020

Undici 2.0.7 was released with the fix from this PR nodejs/undici#449

I updated the dependency with prisma/prisma#3884

It's now in 2.9.0-dev.66 (We recommend to only use latest tag from npm for production, not dev).

Next step: confirm the fix @divyenduz

@Jolg42
Copy link
Contributor

Jolg42 commented Oct 10, 2020

Here is an example on how to pin a Node.js dependency for Netlify and Vercel, thanks to @thedavidprice redwoodjs/redwood#1313 (comment)

Workaround

Pin the version of NodeJS used for Netlify and Vercel build in your .nvmrc file:

  • Replace
// .nvmrc

lts/*
  • with
// .nvmrc

v12.18.4

@Jolg42
Copy link
Contributor

Jolg42 commented Oct 12, 2020

The fix was confirmed with prisma/ecosystem-tests#834

It will be part of the 2.9.0 release tomorrow 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. tech/typescript Issue for tech TypeScript.
Projects
None yet
Development

No branches or pull requests

4 participants