maplibre / maputnik

An open source visual editor for the 'MapLibre Style Specification'
https://www.maplibre.org/maputnik
MIT License
2.14k stars 402 forks source link

Not opening local build #478

Closed azizul-bkash closed 5 years ago

azizul-bkash commented 5 years ago

I have tried to install Maputnik in an AWS EC2 instance with npm. But when I am trying to do npm start its showing the following codes

> maputnik@1.5.0 start /opt/maputnik/maputnik-editor
> webpack-dev-server --progress --profile --colors --config config/webpack.config.js

11295ms building
16ms finish module graph
1ms sealing
0ms basic dependencies optimization
0ms dependencies optimization
1ms advanced dependencies optimization
0ms after dependencies optimization
34ms chunk graph
0ms after chunk graph
0ms optimizing
0ms basic module optimization
1ms module optimization
0ms advanced module optimization
0ms after module optimization
1ms basic chunk optimization
0ms chunk optimization
16ms advanced chunk optimization
0ms after chunk optimization
0ms module and chunk tree optimization
1ms after module and chunk tree optimization
0ms basic chunk modules optimization
0ms chunk modules optimization
0ms advanced chunk modules optimization
0ms after chunk modules optimization
0ms module reviving
0ms module order optimization
1ms advanced module order optimization
5ms before module ids
0ms module ids
9ms module id optimization
1ms chunk reviving
0ms chunk order optimization
0ms before chunk ids
0ms chunk id optimization
5ms after chunk id optimization
0ms record modules
1ms record chunks
52ms hashing
2ms content hashing
0ms after hashing
0ms record hash
1ms module assets processing
125ms chunk assets processing
3ms additional chunk assets processing
2ms recording
0ms additional asset processing
0ms chunk asset optimization
378ms after chunk asset optimization
0ms asset optimization
0ms after asset optimization
1ms after seal
220ms emitting
1ms after emitting

Then I am trying to get access through my desktop using ip X.X.X.X:8888 but there is nothing appearing. If I use the online editor then I was unable to get access the mbtiles as a source from that EC2 instance but tile server and other things are working quietly ok from EC2. Is there any solution for me?

orangemug commented 5 years ago

@azizul-bkash it's probably bound to localhost rather than 0.0.0.0, try

npm start -- --host 0.0.0.0
jdeboer-geoplan commented 5 years ago

Thanks for this @orangemug could this switch be noted in the readme or wiki?

pathmapper commented 5 years ago

@jdeboer-geoplan sure, would you be up for a readme PR?

jdeboer-geoplan commented 5 years ago

@pathmapper documentation isn't really my forte, but I'll give it a look, I suppose a link to the cli options for webpack-dev-server would be most useful.

pathmapper commented 5 years ago

@jdeboer-geoplan no worries, what do you think about the following?

For binding to a different host than localhost use the --host option, e.g. npm start -- --host 0.0.0.0 binds to all hosts.

jdeboer-geoplan commented 5 years ago

@pathmapper, great. webpack's description on https://webpack.js.org/configuration/dev-server/ is

Specify a host to use. By default this is localhost. If you want your server to be accessible externally, specify it like this: --host 0.0.0.0

jdeboer-geoplan commented 5 years ago

@pathmapper to allow someone else to connect to my PC I had to change the config/webpack.config.js to include disableHostCheck: true, I don't suppose we'd want to put that in the docs?

pathmapper commented 5 years ago

@jdeboer-geoplan according to https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck this is not recommended, so we don't want to put that in the docs.

But thanks for mentioning, if someone needs this, it could be now found in this issue.

jdeboer-geoplan commented 5 years ago

@pathmapper yes good point, don't need to accidentally encourage anyone to expose webpack-dev-server to the internet.

pathmapper commented 5 years ago

@jdeboer-geoplan you may want to have a look at https://github.com/maputnik/editor/issues/301#issuecomment-409580386, which suggests two more possible options.