-
Notifications
You must be signed in to change notification settings - Fork 87
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
Sveltekit + Vite unable to import function #36
Comments
I tried this import pkg from 'js-sha3';
const { sha3_512 } = pkg; it works Can you give an example project? |
Thanks for quick response, yes,
|
I use |
5 tasks
mergify bot
pushed a commit
to enso-org/enso
that referenced
this issue
Nov 2, 2023
The first part of #8158. No progress indication for the user implemented. https://github.com/enso-org/enso/assets/6566674/2d8157d4-748f-4442-a9c3-a96ba0029056 # Important Notes A few notable changes: - A fix for `DataServer/writeBytes` - Using `@noble/hashes` instead of `sha3` because the latter only works with node. I also tried using `js-sha3`, but it does not work well with Vite (see emn178/js-sha3#36) - Fixed initialization of the ID map for new nodes. Also, all new nodes are prepended by four spaces to have proper indentation inside the `main` function. - Fixed random pattern name generation because the previous approach sometimes produces identifiers starting with a number.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Sveltekit + Vite + NPM
Attempt 1
I tried to import with
but
npm run build
gives me an error message:Attempt 2
However, when I switch to
I found this runtime error:
My Guess
I doubt the sha3_512 function is tree-shaked by vite compiler, but I'm not sure why.
Possible fix
package.json
?vite build
won't tree-shake the function?The text was updated successfully, but these errors were encountered: