Skip to content
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

mapboxgl-style-spec (v13.0.1): import broken "Can't resolve 'fs' in browser #6984

Closed
lamuertepeluda opened this issue Jul 18, 2018 · 6 comments

Comments

@lamuertepeluda
Copy link

lamuertepeluda commented Jul 18, 2018

I think latest mapboxgl-style-spec is broken for importing into browser. I use it really a lot for creating GeoJSON feature filters dynamically also outside mapboxgl.

Module: mapboxgl-style-spec
Version: 13.0.1 (latest npm available package)
Issue: import broken "Can't resolve 'fs'
Platform: browser

Demonstration: https://stackblitz.com/edit/js-kqrbqj

Latest working version I tried was 11.1.1

@lamuertepeluda
Copy link
Author

lamuertepeluda commented Jul 24, 2018

Guys I just tried with @mapbox/mapbox-gl-style-spec@13.1.0

Problem still exists! Maybe you should consider reopening this issue...

index.js:48 Uncaught Error: Cannot find module 'fs'
    at webpackMissingModule (index.js:48)
    at index.js:48
    at Object.<anonymous> (index.js:48)
    at Object.../node_modules/@mapbox/mapbox-gl-style-spec/dist/index.js (style-spec.js:111)
   ...

@jfirebaugh
Copy link
Contributor

The fix wasn't included in 13.1.0. It will be in the next release.

@lamuertepeluda
Copy link
Author

I see. I'll wait for it. Thanks for your prompt reply :)

@nicholas-l
Copy link
Contributor

I am still getting this error even though I am using 13.1.1-beta.1 and I can see the require('fs') in the dist/index.js file. Has the dist file been updated with the change?

@mollymerp
Copy link
Contributor

Sorry about that @nicholas-l – I just published v13.1.1. Let us know if you still have an issue with that version.

@nicholas-l
Copy link
Contributor

Excellent! thanks for the quite turn around 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants