Skip to content

Error Assertion `args[3]->IsInt32()' failed #35582

Description

@ayungavis
  • Version: v12.19.0
  • Platform: Linux ayungavis 5.4.0-48-generic io.js on The Changelog! #52~18.04.1-Ubuntu SMP Thu Sep 10 12:50:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:

What steps will reproduce the bug?

I tried to follow the tutorial from Adding a Database to GraphQL, this is the code of my script.ts:

const { PrismaClient } = require("@prisma/client")

const prisma = new PrismaClient()

async function main() {
  const allLinks = await prisma.link.findMany()
  console.log(allLinks)
}

main()
  .catch(e => {
    throw e
  })
  .finally(async () => {
    await prisma.disconnect()
  })

How often does it reproduce? Is there a required condition?

Everytime when I run it using node src/script.ts or ts-node src/script.ts.

The requirements:

  • @prisma/cli
  • @prisma/client

What is the expected behavior?

Show all links from the database using prisma client.

What do you see instead?

I tried to run the script.ts using node src/script.ts and ts-node src/script.ts but show the following error:

/usr/bin/node[20367]: ../src/node_http_parser_impl.h:529:static void node::{anonymous}::Parser::Initialize(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[3]->IsInt32()' failed.
 1: 0xa17c40 node::Abort() [/usr/bin/node]
 2: 0xa17cbe  [/usr/bin/node]
 3: 0xa3214a  [/usr/bin/node]
 4: 0xc019e9  [/usr/bin/node]
 5: 0xc037d7 v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node]
 6: 0x1409319  [/usr/bin/node]

Additional information

This is my package.json file:

{
  "name": "learn",
  "version": "1.0.0",
  "description": "A GraphQL Server from scratch for learning purpose.",
  "main": "index.ts",
  "scripts": {
    "start": "dotenv -- nodemon -e ts,graphql -x ts-node src/index.ts",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "dependencies": {
    "graphql-yoga": "^1.18.3"
  },
  "devDependencies": {
    "@prisma/cli": "^2.8.1",
    "@prisma/client": "^2.8.1",
    "@types/node": "^14.11.2",
    "dotenv-cli": "^4.0.0",
    "nodemon": "^2.0.4",
    "ts-node": "^9.0.0",
    "typescript": "^4.0.3"
  }
}

Activity

  1. andredezzy commented on Oct 10, 2020

    @andredezzy

    I'm with the same issue.

  2. devsnek commented on Oct 10, 2020

    @devsnek
    Member

    cc @nodejs/http @nodejs/llnode

  3. andredezzy commented on Oct 10, 2020

    @andredezzy

    @devsnek unavailable...

  4. Flarna commented on Oct 10, 2020

    @Flarna
    Member

    Maybe a dup of #35572?

  5. Flarna commented on Oct 10, 2020

    @Flarna
    Member

    I think the root cause is following backport PR: #34131 which changes the API of the HTTPParser. The API is internal but it looks like it's used by some modules and they pass more then the expected number of arguments which is no longer ignored.

    See also prisma/prisma-client-js#907 and nodejs/undici#448

  6. ChALkeR commented on Oct 11, 2020

    @ChALkeR
    Member

    https://github.com/nodejs/undici/blob/master/lib/node/http-parser.js#L3-L4 — caused by using the internal API directly.
    Usage of that API should be fixed in undici@2.0.7: nodejs/undici#448 (comment)

    Could you confirm that resolving undici to 2.0.7 helps?

  7. ayungavis commented on Oct 11, 2020

    @ayungavis
    Author

    For now I'm downgrading my node version to v12.18.4 until the bug is fixed. It's work properly when you use node v12.18.4.
    Thank you all about the replies, hopefully it will be fixed soon.

  8. ChALkeR commented on Oct 11, 2020

    @ChALkeR
    Member

    From the available information, it doesn't look like a bug in Node.js.
    Let's close this as a duplicate of #35572, as it's unlikely that any new information will be present here.
    I'll reopen if there will be any new info hinting that's not the case.

  9. added
    duplicateIssues and PRs that are duplicates of other issues or PRs.
    on Oct 11, 2020
  10. ChALkeR commented on Oct 12, 2020

    @ChALkeR
    Member

    It was confirmed in #35572 that using a fixed version of undici helps.

  11. added
    wrong repoIssues that should be opened in another repository.
    on Oct 12, 2020
  12. maguri commented on Dec 2, 2021

    @maguri

    Prisma Issue

    • nodejs 16.13.1
    • @prisma/client ^2.13.1
    • Windows 10

    For me it was a problem after upgrade to node 16.13.1
    Now I use nvm for Windows, and with node 14.8.0 it works again.

    The problem is when you start and generate all the prisma schema with some version and then you change it.

    If you want to keep your node updated you probably need to prisma generate all again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.wrong repoIssues that should be opened in another repository.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions