-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Export was not found when importing LocateControl #1
Comments
Hi there! I think this is actually an issue with Webpack, at least as far as I could find: I don't know which version of webpack CRA is using, but I believe even the React maintainers no longer recommend that anyone use CRA. I would highly recommend checking out the React template from Vite! npm create vite@latest my-react-app -- --template react-ts I'm going to close this but if you're still running into this issue with Vite, please feel free to reopen :) |
Thank you for the response @TurtIeSocks . I'm planning to migrate to Vite + React (probably after React 19 is released), so I can report back when that's done. Well, since the demo uses Vite + React, I assume it will be fine. I've recently learned that file extensions in ESM are mandatory1, and that module specifiers aren't transformed in TypeScript. It follows that the extensions must be specified in TypeScript when package.json has For the above reason, I maintain that this is an issue with the package, not webpack or CRA. It's convenient that Vite with its bundler makes it work anyways, but the same can't be guaranteed in other environments. If including If anybody gets the same error, for a workaround, the In any case, thank you for this package @TurtIeSocks ! ❤️ Footnotes
|
It was great to find this fresh library just when I needed it. Thank you!
When I imported it to my CRA project:
I got
I had to import it from the specific file
to resolve this.
I think this can be fixed by explicitly adding extension
.js
here.If that's not enough, maybe also including
in
tsconfig.json
compilerOptions
could help. Not sure about that one.The text was updated successfully, but these errors were encountered: