-
Notifications
You must be signed in to change notification settings - Fork 18
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
0.4.5 Error - Cannot read properties of undefined (reading 'subtle') #19
Comments
Sounds like the driver is trying to access SubtleCrypto in a context where it's not available.
|
Well, it seems to be fixed with 0.4.9 (also works in 0.4.4 and lower). However with 0.4.9 I'm getting this now on Cloudflare Pages (using Workers under the hood) - |
OK, good to hear. I think changes in the underlying pg package, which I'd previously omitted to pin to a specific version, must have been responsible for the earlier issues, then. I've not encountered this new error before. Are you able to provide a simple repro? |
Sure, here it is - https://github.com/v-moravec/drizzle-cf-error, hope it helps. I turned off minification so error messages are clear. Everything else that needs to be setup is in readme. |
OK, I think the relevant change in 0.4.4 is that we introduced a default export (we're testing something here that will be launched soon). Anyway, it seems the default import is breaking named imports in this particular context. I'm not yet sure where the fault lies, if anywhere, because judging by these esbuild issues (evanw/esbuild#1719, evanw/esbuild#532), default import interoperability is a minefield. So I worry that fixing this may break something else. But anyway, I'm continuing to investigate ... |
I've just released 0.4.10, which I believe will fix your import problem. Please do let me know either way. |
I can confirm everything works as expected now. |
Steps to reproduce
npx nuxi init <project-name>
yarn add drizzle-orm @neondatabase/serverless
yarn add -D drizzle-kit
db.ts
Expected result
Should work
Actual result
Instead throws error
Environment
Nuxt 3.5
@neondatabase/serverless 0.4.5
Node v18.12.0
Logs, links
ERROR [worker reload] [worker init] Cannot read properties of undefined (reading 'subtle') 3:07:35 PM
at node_modules/@neondatabase/serverless/index.js:1:59242
at node_modules/@neondatabase/serverless/index.js:1:347
at node_modules/@neondatabase/serverless/index.js:1:60107
at node_modules/@neondatabase/serverless/index.js:1:347
at node_modules/@neondatabase/serverless/index.js:46:2299
at node_modules/@neondatabase/serverless/index.js:1:347
at node_modules/@neondatabase/serverless/index.js:46:25042
at node_modules/@neondatabase/serverless/index.js:1:347
at Object. (node_modules/@neondatabase/serverless/index.js:46:25975)
at Module._compile (node:internal/modules/cjs/loader:1159:14)
The text was updated successfully, but these errors were encountered: