-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Can't use Grommet with Parcel - Uncaught Error: Cannot find module './Box/doc' #2719
Comments
If I run There's an issue raised at grommet/grommet#2618 which discusses the change in Grommet which broke Parcel support. Something to do with changing to use higher-order components. |
This is caused by this bit of code: if (process.env.NODE_ENV !== 'production') {
doc = component => require(`./${component}/doc`).doc; // eslint-disable-line
} I don't think Parcel doesn't support these kind of dynamic imports with a non-static argument. Webpack does however. https://webpack.js.org/guides/dependency-management/ Running with NODE_ENV set to production is indeed a workaround: |
This was resolved at the Grommet side in PR grommet/grommet#2944 and released in version 2.6.5, which I've tested now works fine with Parcel again. Not sure whether you want to support the dynamic imports. |
Ideally, we would: #125 |
🐛 bug report
When importing the
grommet
package, I get unexpected errors.🎛 Configuration
I created a very basic React app to reproduce the issue:
package.json
index.html
index.js
🤔 Expected Behavior
Should run without issues.
😯 Current Behavior
Error as detailed in description.
💁 Possible Solution
I'm not sure of the cause.
🔦 Context
Trying to use Grommet to build a React application for a demo instead of the material-ui components I might otherwise use.
💻 Code Sample
As above.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: