-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Issue with Waku and Prisma #1175
Comments
https://unpkg.com/browse/@prisma/[email protected]/package.json Maybe, "default" in "import" is missing. https://publint.dev/@prisma/[email protected] Hmm, it looks okay. It should pick the root default then. Thanks for reporting. I'm not exactly sure where is the problem, but there must be something. |
So, there are three issues. Module resolution issueAs I noted, adding --- node_modules/@prisma/client/package.json.orig 2025-01-23 09:56:21
+++ node_modules/@prisma/client/package.json 2025-01-23 09:56:45
@@ -50,7 +50,8 @@
"edge-light": "./default.js",
"workerd": "./default.js",
"worker": "./default.js",
- "browser": "./index-browser.js"
+ "browser": "./index-browser.js",
+ "default": "./default.js"
},
"default": "./default.js"
}, Alternatively, you can specify // waku.config.ts
import { defineConfig } from 'waku/config';
export default defineConfig({
unstable_viteConfigs: {
common: () => ({
ssr: {
resolve: {
conditions: ['node'],
},
},
}),
},
}); (vite.config.ts can do the same.) See also: remix-run/react-router#12610 ESM issue (DEV only)This works: import { default as Prisma } from "@prisma/client";
const prisma = new Prisma.PrismaClient(); Bundling issueSee vitejs/vite#19036 and its workaround. In summary, this seems too tricky, and there's nothing particular that Waku can do. But, if anyone has suggestion for possible fixes, feel free. |
Should this be flagged to https://github.com/prisma/prisma ? They may be open to just changing the exports field. |
Feel free to do it, but there might be already something filed. |
oh wow they have a lot of open issues... I'll leave that up to @skorotkiewicz about whether or not to file a new issue over there. |
It seems impossible to use databese Prisma with waku, how can I use Prisma with Waku?
The text was updated successfully, but these errors were encountered: