question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

keycloak-js 17.0.0: Can't import the named export 'sha256' from non EcmaScript module

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
eevers-avisicommented, Feb 24, 2022

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.

2reactions
SamHCococommented, Feb 19, 2022

getting the same error message here. how were you able to resolve this issue?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found