Open dzcpy opened 1 year ago
I meet too
I managed to fix this, by adding the ".js" at the end of the import for all files that does import JS:
also I had to add type="module" for both package.jsons in runtime and shared folder
it seems this topic is quite known in TS community: https://stackoverflow.com/questions/62619058/appending-js-extension-on-relative-import-statements-during-typescript-compilat
The other solution I've found is by changing the babel config and tsconfig for both packages to generate the CommonJS files instead of ESM.
I'm having this same issue with next.js as well.
I fixed it to this code
const nextConfig = {
...
transpilePackages: ['@locator/runtime'],
}
Where the bug happens
your browser
No response
Describe the bug
When using
@locator/runtime
:It prompts this error message:
To reproduce
import setupLocatorUI from '@locator/runtime' if (process.env.NODE_ENV === 'development') { setupLocatorUI() }
Additional information
No response