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

Module not found: Error: Can't resolve 'fs' while using new MapboxDraw() #13289

Closed
devcer opened this issue Dec 23, 2018 · 2 comments
Closed

Comments

@devcer
Copy link

devcer commented Dec 23, 2018

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ x] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node : 8.9.4
npm: 6.5.0
ng: 6.0.0
mapbox-gl-js version: 0.52.0
mapbox-gl-draw version: 1.1.1
ubuntu 18

Repro steps

npm i mapbox-gl && npm i @mapbox/mapbox-gl-draw
Include styles in angular.json and import mapbox using below lines
import * as mapboxgl from 'mapbox-gl';
import * as MapboxDraw from '@mapbox/mapbox-gl-draw';
Initialise MapboxDraw as
this.draw = new MapboxDraw();

The log given by the failure

ERROR in ./node_modules/jsonlint-lines/lib/jsonlint.js
Module not found: Error: Can't resolve 'fs' in '/home/Documents/projects/Project_name/node_modules/jsonlint-lines/lib'
ERROR in ./node_modules/jsonlint-lines/lib/jsonlint.js
Module not found: Error: Can't resolve 'path' in '/home/gaian/Documents/projects/Project_name/node_modules/jsonlint-lines/lib

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 23, 2018

We only support building browser apps, and while building browser apps node native modules like fs are not available.

You can read more about why we disabled these imports in #9827.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants