-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
As of @sveltejs/kit version 1.0.13, crypto
doesn't seem to be polyfilled during build-time
#8655
Comments
You could confirm whether it's that PR by testing with 1.0.3 and 1.0.4 and reporting whether or not they work I would also be curious if either |
Good tip — tracked it down to a version 1.0.13 which was this PR: #8429 Stackblitz is updated as well. |
crypto
doesn't seem to be included (?)crypto
doesn't seem to be polyfilled during build-time
Problem is that |
I brought this up in another issue, but it seems this is the most relevant issue. I am seeing pretty much the same error described in here, except with the In our case, we actually want to disable prerendering entirely. I gather, from the comments on the other issue, that this is not really prerendering, despite what the error message claims. Hopefully the error messages in this phase can be adjusted, as well as fixing the issue itself. |
The solution we're going with for now came from a Discord post, and some other issues related to prerendering: We're using the
|
Describe the bug
Looks like prior to 1.0.13,
crypto
(the webcrypto global) was polyfilled. Now it doesn't seem to be. (Usingadapter-cloudflare-workers
if that makes a difference.)For example: this code will prevent
vite build
from completing:if (typeof crypto === 'undefined') throw new Error('this explodes `vite build`')
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-zank98?file=README.md,src%2Froutes%2F%2Bpage.js,package.json&terminal=dev
Steps to repro:
npm run build
with SK 1.0.12. Note it builds fine.npm i -D @sveltejs/kit@1.0.13
npm run build
and observe thatsrc/pages.js
throws an error becausecrypto
is undefinedLogs
No response
System Info
Severity
blocking an upgrade
Additional Information
Tried to debug this as best I could and it may be related to this PR: #8429
The text was updated successfully, but these errors were encountered: