Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

Invalid or unexpected token #3

Open
BjoernRave opened this issue Oct 13, 2021 · 3 comments
Open

Invalid or unexpected token #3

BjoernRave opened this issue Oct 13, 2021 · 3 comments

Comments

@BjoernRave
Copy link

I donwloaded the latest assets, used chmod and specified the path as env vars in .env, but when trying to run prisma -v it returns:

Error: Unable to require(`/home/pi/vanfront/prisma/prisma-engines/libquery_engine.so`)
 Invalid or unexpected token

I used prisma version 3.2.1

I know, that this might be rather a problem of prisma itself, but I thought I ask here first, maybe I am just doing something small wrong

@pantharshit00
Copy link
Owner

Looks like something is up with the build as I can also reproduce this.

Use the following env variables as a workaround for now:

PRISMA_CLI_QUERY_ENGINE_TYPE=binary
PRISMA_QUERY_ENGINE_TYPE=binary

@BjoernRave
Copy link
Author

BjoernRave commented Oct 14, 2021

Thansks alot. Now prisma -v is working. However when trying to use prisma in a next application I get the following error:

Query engine library for current platform "linux-arm-openssl-1.1.x" could not be found.
You incorrectly pinned it to linux-arm-openssl-1.1.x

This probably happens, because you built Prisma Client on a different platform.
(Prisma Client looked in "/home/pi/vanblitz/node_modules/@prisma/client/runtime/libquery_engine-linux-arm-openssl-1.1.x.so.node")

Searched Locations:

  /home/pi/vanblitz/node_modules/.prisma/client
  /home/pi/vanblitz/node_modules/@prisma/client
  /home/pi/vanblitz/node_modules/@prisma/client
  /home/pi/vanblitz/node_modules/.prisma/client
  /home/pi/vanblitz/db
  /tmp/prisma-engines
  /home/pi/vanblitz/node_modules/.prisma/client


To solve this problem, add the platform "linux-arm-openssl-1.1.x" to the "binaryTargets" attribute in the "generator" block in the "schema.prisma" file:
generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native"]
}

the start of my schema.prisma looks like this:

  provider = "sqlite"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js",
}

Nowhere did I specify: linux-arm-openssl-1.1.x

I ran prisma generate and I have @prisma/client in my node_modules

Do you have an idea?

@pantharshit00
Copy link
Owner

@BjoernRave Add:

generator client {
  provider = "prisma-client-js"
  engineType = "binary"
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants