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

[deno compile] Details: LoadLibraryExW failed #26095

Closed
leonco opened this issue Oct 10, 2024 · 9 comments
Closed

[deno compile] Details: LoadLibraryExW failed #26095

leonco opened this issue Oct 10, 2024 · 9 comments
Labels
bug Something isn't working correctly compile related to the `deno compile` feature

Comments

@leonco
Copy link

leonco commented Oct 10, 2024

Version: Deno 2.0.0
I setup an example prisma project,

deno run -A main.ts

works fine,

deno compile -A -o hello.exe ./main.ts

also generate a executable file hello.exe,

But when i run

./hello.exe

an exception thrown:

error: Uncaught (in promise) PrismaClientInitializationError: Unable to require(`C:\Users\leo\AppData\Local\Temp\deno-compile-hello.exe\hello-prisma\node_modules\.deno\@prisma+client@5.20.0\node_modules\.prisma\client\query_engine-windows.dll.node`).
The Prisma engines do not seem to be compatible with your system. Please refer to the documentation about Prisma's system requirements: https://pris.ly/d/system-requirements

Details: LoadLibraryExW failed
    at Object.loadLibrary (file:///C:/Users/leo/AppData/Local/Temp/deno-compile-hello.exe/hello-prisma/node_modules/.deno/@prisma+client@5.20.0/node_modules/@prisma/client/runtime/library.js:110:10219)
    at async Ar.loadEngine (file:///C:/Users/leo/AppData/Local/Temp/deno-compile-hello.exe/hello-prisma/node_modules/.deno/@prisma+client@5.20.0/node_modules/@prisma/client/runtime/library.js:111:448)
    at async Ar.instantiateLibrary (file:///C:/Users/leo/AppData/Local/Temp/deno-compile-hello.exe/hello-prisma/node_modules/.deno/@prisma+client@5.20.0/node_modules/@prisma/client/runtime/library.js:110:12575)

@petamoriken
Copy link
Contributor

duplicate of #16642

@yazan-abdalrahman
Copy link
Contributor

@leonco
Can you provide me with the main.ts to try to reproduce the issue?

@leonco
Copy link
Author

leonco commented Oct 10, 2024

main.ts

import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const { PrismaClient } = require("@prisma/client");

const prisma = new PrismaClient()

deno.json

{
  "tasks": {
    "dev": "deno run --watch main.ts"
  },
  "imports": {
    "@hono/hono": "jsr:@hono/hono@^4.6.2",
    "@prisma/client": "npm:@prisma/client@^5.20.0",
    "@std/assert": "jsr:@std/assert@1",
    "@std/crypto": "jsr:@std/crypto@^1.0.3",
    "@std/encoding": "jsr:@std/encoding@^1.0.5",
    "prisma": "npm:prisma@^5.20.0",
    "winston": "npm:winston@^3.14.2",
    "winston-daily-rotate-file": "npm:winston-daily-rotate-file@^5.0.0"
  },
  "nodeModulesDir": "auto"
}

@leonco
Copy link
Author

leonco commented Oct 10, 2024

if i use esm import ,

import { PrismaClient } from "@prisma/client"
const prisma = new PrismaClient()

an error happed:

error: Uncaught SyntaxError: The requested module '@prisma/client' does not provide an export named 'PrismaClient'
import { PrismaClient } from '@prisma/client'

@littledivy littledivy added bug Something isn't working correctly compile related to the `deno compile` feature labels Oct 10, 2024
@xxhertz
Copy link

xxhertz commented Oct 15, 2024

any known temporary solution to this?

@andresribeiro
Copy link

even with deno install --allow-scripts i still cant use prisma

@lucacasonato
Copy link
Member

The original report from @leonco is a duplicate of #23266 (deno compile does not support native addons yet).

I can not reproduce the error: Uncaught SyntaxError: The requested module '@prisma/client' does not provide an export named 'PrismaClient' that @leonco also described. Please provide a full reproduction to get this error (with the commands you are running). I am doing this in a folder with the two files you provided:

$ deno install --allow-scripts
$ deno run -A main.ts

@lucacasonato
Copy link
Member

@andresribeiro Please open an issue with reproduction.

@lucacasonato
Copy link
Member

Closing as the original issue here was a dupe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly compile related to the `deno compile` feature
Projects
None yet
Development

No branches or pull requests

7 participants