-
Notifications
You must be signed in to change notification settings - Fork 593
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
Built file in master requires fs #970
Comments
I'm also encountering this issue. Can somebody who understand what these packages do figure out how to replace these dependencies to not rely on dead code? |
Including fs and path in externals is not sufficient when this is used in a browser. That will just make rollup leave the requires calls, and when you try to include this library in a webpack project webpack will complain that fs is missing. By providing shims for fs and path, those will be used instead of require calls, so that fixes the issue. Since no code paths in this library triggers the code that requires fs or path it's safe to just shim them out with an empty object. Fixes mapbox#970
A fix would be much appreciated! @trygveaa would that PR you've linked fix this issue as well? Or would we need to wait for a downstream fix here? As others have said, this seems to fix it for me: |
Yes, #977 fixes this issue. However I've written some comments for discussion in it, because I don't think bundling all the dependencies in the single js file is a good idea. Though, that already happens, so there are no downsides of #977 over the current situation.
That works because the issue I'm describing in here doesn't exist in version To be clear, even though these are related, the issue I'm describing here is not the same as those issues. Those issues is about the main entry point for the package requiring PR #976 fixes what those issues describe, so you don't have to specify the |
Now v1.2.0 is the current on npm and this module has become unusable by default because of this issue. I don't get how could it get out of beta and published like that. |
Hi! I am a mapbox customer trying to use this tool for a product and I was wondering if this issue will be fixed soon? |
@dougturnkey I wouldn't wait for this to be patched, could take a minute. If you can live with the 1.1.2 version I downgraded to that and got it running without the fs error. |
Nothing? |
Hey, any hope? |
Is there any reason we couldn't just replace the usage of After all,
|
Yeah... why would this get published with this error... |
I'm having the same issue with fs as OP stated |
In reference to #626 (comment), Doing: node: {
fs: "empty"
} (in the webpack config) |
Requires a fix in the webpack config due to mapbox/mapbox-gl-draw#970
Any chance we could get this fixed and released? |
For webpack 5 use //webpack.config.js
module.exports = {
...
resolve: {
fallback: {
"fs": false
},
}
} |
|
+1 Can anyone help solve historical problems? |
In case someone is struggling with this; on webpack 5 only the following helped:
|
👋 This should now be fixed with v1.2.1 |
mapbox-gl-js version: 1.8.1
mapbox-gl-draw version: master
Steps to Trigger Behavior
yarn && yarn build-min
dist/mapbox-gl-draw.js
in a projectExpected Behavior
It should work, without depending on
fs
.Actual Behavior
I can't use it because it depends on
fs
. That is, I'm getting:If I try to do the same after checking out
v1.1.2
it works fine.The text was updated successfully, but these errors were encountered: