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

jsonlint error when importing library #626

Closed
davedbase opened this issue Apr 11, 2017 · 4 comments
Closed

jsonlint error when importing library #626

davedbase opened this issue Apr 11, 2017 · 4 comments

Comments

@davedbase
Copy link

mapbox-gl-js version:

Whatever is bundled with the latest version of draw.

mapbox-gl-draw version:

Using version 0.16

Steps to Trigger Behavior

Import the library using import MapboxDraw from '@mapbox/mapbox-gl-draw';

Expected Behavior

I'm using webpack to pull the library into my application. I tracked down the line in jsonlint and for some reason it appears it's making a call with the fs library. I kind of gave up and just used the CDN version.

Actual Behavior

client:119 .//jsonlint-lines/lib/jsonlint.js
Module not found: Error: Can't resolve 'fs' in '/Users/ddibiase-macbook/Projects/usi-compass-api/public/node_modules/jsonlint-lines/lib'
@ ./
/jsonlint-lines/lib/jsonlint.js 692:17-30
@ .//@mapbox/geojsonhint/lib/index.js
@ ./
/@mapbox/mapbox-gl-draw/src/api.js
@ ./~/@mapbox/mapbox-gl-draw/index.js
@ ./src/views/questions/pathmap.js
@ ./src/views/questions.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server ./src/index.js

@davedbase
Copy link
Author

Ah shoot, after more searching found this issue here: mapbox/mapbox-gl-js#1649.

This was a webpack issue not related to the library. This needed to be added to webpack config:

  node: {
    fs: "empty"
  }

@mitulgolakiya
Copy link

mitulgolakiya commented May 25, 2018

@ddibiase any idea where and in which file should I add this block while using this with Angular 6?

@a-faraz
Copy link

a-faraz commented Jun 1, 2018

@mitulgolakiya did you every figure this out for Angular 6?

edit: Using this workaround here helped me for angular 6 #10681 (comment)

@ParryQiu
Copy link

ParryQiu commented Jan 8, 2019

Not elegant but effective, just hacked the code directly.
file path: /node_modules/jsonlint-lines/lib/jsonlint.js
comment the codes from line 688 - 693, it works.

code comments

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