keycloak-js 17.0.0: Can't import the named export 'sha256' from non EcmaScript module
See original GitHub issueDescribe the bug
Hi,
since Keycloak-js 17.0.0 the import from node_modules is broken.
The build fails with ` Failed to compile.
./node_modules/keycloak-js/dist/keycloak.mjs Can’t import the named export ‘sha256’ from non EcmaScript module (only default export is available) `
Beware - this is not a compile error of the application, but seems to be an issue in the library. Previous versions, like all 16.x.x work fine.
Version
17.0.0
Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Anything else?
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Can't import the named export XXXX from non EcmaScript ...
the solution is to make sure that you have a webpack.config.js file in the root of your project directory that looks something like...
Read more >Keycloak 18.0.0 released
In this release, it was completely removed, and it is no longer ... Can't import the named export 'sha256' from non EcmaScript module...
Read more >Can't import the named export from non EcmaScript module
Hi My site name is stupefied-lamarr-20c8d9 On the server side of my app I have lambda functions and within those I'm using apollo-server-lambda...
Read more >keycloak-js - npm
Keycloak Adapter. Latest version: 20.0.1, last published: a month ago. Start using keycloak-js in your project by running `npm i ...
Read more >when to not use export default in javascript Code Example
Three different export styles export foo; export default foo; ... Can't import the named export 'Children' from non EcmaScript module (only default export ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue also still occurs for me. Updating node_modules will not fix this, because the next time you’ll clean your node_modules or build your application elsewhere, those changes will be gone.
This worked for me: go the ‘keycloak.mjs’ under ‘node_modules/keycloak-js/keycloak.mjs’ and remove the curly braces from the ‘sha256’ import at the top of the file - not an ideal solution but it should prevent the compilation error.