-
Notifications
You must be signed in to change notification settings - Fork 148
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: Error: Cannot resolve module 'fs' #87
Comments
I haven't spent much time on webpack support yet, I can try to look into it. In the meantime - are you using any RPC-specific functionality? If not, you might be able to fix it by requiring |
That is a common error which I solved like this: josephsavona/valuable#9 (comment) |
@mtth Thanks for the response. The use of the library is pretty simple right now, just using a schema to build a buffer and decode a buffer. Other stuff would be cool, but it's needed at this point. In my simple test app this morning, the import It might be nice to have a good story re: webpack on the front page README, because any kind of facebook type dev stack in probably going to use it, at a minimum. Another option might be to build a avsc-browser npm package? On the other hand, if it doesn't generally cause a problem, or finds minimal use on the browser, I don't know if that would be worth it. Something to consider though. @Tamriel Yeah, that's true, but I'd rather not require downstream library users to have to do this as the actual situation is: user-code depends on visualization-library depends on timeseries-library--with-avro-support depends on avsc. Another concern is they may not control their webpack configs either, e.g. create-react-app. [ Edit: though it does seem that at some point mocking fs and friends (if that's the right way to describe what webpack is doing) was added to create-react-app's config. But even still importing the top level entry point of avsc causes a |
After thinking about it for a while, here's a plan that should work:
The first change should go live with |
That sounds perfect. |
Just released |
Hi, thanks for this library, but I'm trying to integrate this in a timeseries library of ours so that users can serialize in avro. This works fine on node, but when I bring this library into another library used in the browser (timeseries visualization), I get this webpack error:
I tried to import like so:
but that didn't help. Any ideas how to deal with this without having downstream libraries having to mock fs etc. ?
The text was updated successfully, but these errors were encountered: