-
Notifications
You must be signed in to change notification settings - Fork 362
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
Using Microbundle package in create-react-app: Webpack errors #1023
Comments
Suspect it's a fight between webpack being fussier and microbundle not adding qualified imports: developit/microbundle#1023
Followup - reverting react-scripts to 4.0.3 and hacking round the corresponding OpenSSL error makes this work, so the "webpack got fussier about imports" theory seems to hold water. But I don't want to expose my users to this pain, obviously... :-) |
You have three real options:
I'd lean towards no, as it's not really correct usage.
However, this is what Edit: BTW, you should set |
On advice of Ryan Christian of microbundle - fixes problem with webpack path resolution when importing into CRA - see developit/microbundle#1023
Thanks great, many thanks for such a fast and accurate response! Using the 'barrel' does indeed work and makes the code a lot neater too! On the --jsx in the build, I had actually already realised I don't need any of them, although I am still getting errors like:
|
Ah, yeah sorry, #988 exists to fix that |
Hi,
I'm having trouble using my microbundle-built package in a standard create-react-app project.
I've created @sandtreader/rafiki using microbundle, and it builds and publishes to npm fine (thanks!).
However when I come to use it in an internal create-react-app, it installs fine but then fails with lots of webpack errors on build / start:
Now (as through a glass, darkly) I take this to mean that webpack is using the '.modern.js' file but that the imports don't have extensions on them. Here is the import from the published .modern.js:
import v from"@mui/material/Button"
There are quite a few issues around CRA reporting this - it seems to come from a recent webpack update - but their response seems to be it's the package provider's problem - in this case, me :-)
facebook/create-react-app#11865
webpack/webpack#11467 (comment)
I have no idea if they are right or not, but if so, could microbundle fully specify the import?
Thanks!
The text was updated successfully, but these errors were encountered: