-
Notifications
You must be signed in to change notification settings - Fork 50
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
Module not found : Can't resolve 'fs' #84
Comments
You should give more context. Is your application working in other environments? |
|
Have you followed instructions and installed both |
Yes, I have installed both the library namely mjml-react and mjml. I am writing a component that, I can export (named export) into my main index.js as a result its throwing errors, which are
|
This is core node libraries. I assume they can be unresolved only if you are doing something for browser. Then look for ideas #52 In the end it is not problem with the library. I am closing this issue now. Please return with working reproducible example if you want to reopen it. |
@daliusd - I know you've closed this ticket as resolved due to core node libraries being used and I get that, but I do think its worth a discussion. Being able to use react-mjml in a browser enviornment only breaks after the minify changes were introduced in the latest release (fine in 2.0.7, doesn't work in 2.0.8) as part of #75. In my opinion, leave minification up to the consumers of the application, if folks are working with React they most likely have some sort of bundling tooling in place already such as rollup/webpack/etc. where they can minify the output however they want. Otherwise at least make it opt-in, update it to be a peer dep and as of NPM7 we can annotate those to optional, then enable minification if that peer dep is included. That allows you to have minifcation and still continue to support those browser use cases. Thanks! EDIT: This did end up being a breaking change for us so it coming through as a patch semver change wasn't great for automatic dependency management |
After installing npm mjml-react and when i try to import any element such as import {mjml} from 'mjml-react'. it is throwing an error which says "Module not found : Can't resolve 'fs' ". Please guide me through on how to render in inside my NGINX web application.
The text was updated successfully, but these errors were encountered: