react-focus-lock
react-focus-lock copied to clipboard
Failing to import ESM module in Node
A consumer of our component library is trying to import react-focus-lock in Vitest as a nested dependency which is failing because Node imports the ESM module as { default: FocusLockComponent }
rather than FocusLockComponent
I have a reproduction here. If you run yarn workspace common node-test
then it shows that the component is being imported incorrectly.
I think a solution might be to use the .mjs
extension for the dist/es2015 folder but I'm not totally sure