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

0.23.0 causing webpack build issues #261

Closed
fridgerator opened this issue Dec 7, 2017 · 7 comments
Closed

0.23.0 causing webpack build issues #261

fridgerator opened this issue Dec 7, 2017 · 7 comments

Comments

@fridgerator
Copy link

Hello, I work with @Mesonyx

After updating to 0.23.0 our webpack build is failing with the following error: Unexpected token name «n», expected punc «;» when building our applications vendor.js file.

If I downgrade back to leaflet.pm 0.22.0, I no longer see that error.

I noticed in the leaflet.pm.min.js file there is still es6 syntax: for(let n in e)

My webpack skills are not very good, but should the min.js distributed file contain es6?

I was able to get around this by loading the leaflet.pm.min.js file through babel on our production builds.

Thanks!

@jpknapp
Copy link
Contributor

jpknapp commented Dec 7, 2017

Hey @fridgerator,
I was also having this issue, you're right, it's because the build is es6
I got it to work by adding this to the leaflet.pm webpack config, and making a new build:

modules: {
  loaders: [{
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: {
          presets: ['es2015'],
        }
      }],
...
}

@codeofsumit
Copy link
Contributor

thank you for reporting this. Will check and fix asap!

@mpschaeuble
Copy link

mpschaeuble commented Dec 14, 2017

Took me now several hours to figure out that this is the reason for my failing test execution in phantomjs of an angular-cli build :-(
Couldn't figure out to transpile 3dr-party libraries with angular-cli, therefore downgrading to 0.22.0.
Would be really helpful to fix this issue asap, thanks!

@codeofsumit
Copy link
Contributor

hey everyone. Thanks for being so patient. Can someone try out this ☝️ commit and verify that the build is not failing? It works for me but a second test would be helpful.
If I get a +1 on it, I'd release asap

@hoeck
Copy link

hoeck commented Dec 15, 2017

Checked out 8cd2a8a and built it but the resulting dist/leaflet.pm.min.js is full of let keywords i.e. not valid ES5 and will fail in Phantomjs as well as when piped through UglifyJS (such as in our production build).

@codeofsumit
Copy link
Contributor

Can you delete your node_modules folder, do a fresh npm install and try again?

@hoeck
Copy link

hoeck commented Dec 16, 2017

Did that before already a couple of times to be sure. Now I did it again but this time used plain npm and now it works.

Guess my mistake was using yarn initially to install the dependencies & create the build. Sorry for the delay.

So 👍 from my side for your fix! Thanks!

codeofsumit added a commit that referenced this issue Mar 14, 2018
* Fire Circle Edit Event

* added start script

* removal button now respects pmIgnore, fixes #172

* add babel polyfill

* added polyfill to build config as well

* wops, forgot it here 🤔

* added polyfill to fix #173

* removed babel-polyfill

* * More polyfills for IE:
  - Object.assign() is needed for snapping
  - Element.remove() is needed when removing control buttons
* demo.js dumbed down for IE11:
  - IE doesn't understand thoose fancy lambdy style expressions
  - object literals always need a key

* increased version

* 0.17.1

* link to new demo page

* fix #179

* fix #180

* version bump

* 0.17.2

* fixed manual install desc

* fix #182

* removed uncessary if statement

* used setLatlngs to update LInes and Polygons. Hopefully fixes #181

* fixed coord diff from line and poly

* clarified function name

* removed console.log

* added circle toolbar option

* check map drag state before changing it - fix #189

* fix #185

* another demo test

* thing

* updated version

* 0.17.3

* markers are correctly created

* updated gif

* continued

* cursorMarker: true is now default

* Change the source map and minimise the source

* Should be const not var

* fixed the middlemarker position problem

* you can now add markers

* markers can now be removed

* cleanup

* snapping works again 🎉

* Dragging now supports holes

* cleanup

* minor cleanup

* basic drawing works 🎉💪

* map drag fix

* removed test console log

* better comments

* removed console logs

* properly removing cutting events

* prevent pm:remove event from being fired

* splitting polygons works now

* updated demo tiles

* made first map more demo friendly

* handle toolbar button correctly

* fixed typos

* updated leaflet

* updated readme

* 0.18.0

* removed console.log

* FIXED: Vertex Removal removes layer or hole (patch) (#209)

* ADDED: `pm:cut` event (minor) (#211)

* added cut to layerGroup

* fire cut event on map and layer

* updated with cut event info

* added some code comments

* added cutPolygon button to toolbar options

* minor things

* ADDED: Rectangle Support for Drawing and Editing (#196)

* IMPROVED: Rearranged Toolbar and renamed some buttons (patch) (#212)

* rename toolbar buttons, rearrange them, add backwards compatibility

* updated options

* added backwards compatibility with toggleButton

* FIXED: marker edit respects draggable option now (patch) (Fixes #213)

* updated version and added rect desc

* 0.19.0

* updated URL to new demo page

* Make HintMarker more visible (#220) (PATCH)

* hopefully fix #226

* added marker index information to markerdrag events. Fixes #225 (PATCH)

* Removed sourcemaps from prod build. Fixes #222 (PATCH)

* add workingLayer to pm:drawstart (#221) (PATCH)

* add workingLayer to pm:drawstart

* update documentation and demo according to feedback on PR

* minor wording fix

* nothing

* minor webpack optimization

* Added Vertex Events (#227) (MINOR)

* added first demo case

* added pm:vertexadded event to drawing lines and polygons

* added vertexadded and vertexremoved events to Edit class of Line and Polygon

* added documentation

* added syntax highlighting to markdown js 🙄

* Fix error when removing a layer during snappable drawing;
 fixes #208 (MINOR)

* version bump to 0.20.0

* 0.20.0

* centerMarker is not draggable anymore during Circle Draw. Fixes #230 (patch)

* removed console.log

* removed cdnjs button

* - remove extra script tag from demo (#232)

* Added `finishOn` option to pass events on which to finish drawing (#233) (minor)

* add option to pass event name to perform finish of polygon

* update docs

* fix demo example, no event for finishOn

* test

* properly unbind optional listener

* added fallback for finishOnDoubleClick

* added finishOn example

* removed test

* fixed bug in fallback

* prevent zoom when dblclick finishes shape

* added example how options can be passed to toolbar buttons

* fixed encoding error

* stopped the stupid thing of manually entering the versions into the CDN links 🤦‍♂️

* 0.21.0

* Create CODE_OF_CONDUCT.md

* Create CONTRIBUTING.md

* Create LICENSE

* remove license in favor of LICENCE.MD

* Create ISSUE_TEMPLATE.md

* Update ISSUE_TEMPLATE.md

* Update README.md

* better code syntax highlighting

* updated turf and webpack

* Fix 🐛  for switching drawing modes, fixes #242 and other problems (patch) (#240)

* ADDED: `allowSelfIntersection` option (minor) (#241)

* started on it

* kinda works

* nothing

* ok works for drawing

* lots of stuff is working now

* invalid style is resetted on disable

* hasSelfIntersection now works without edit mode

* added code comments

* added README docs

* style is now handled by css class

* fix when vertex removal causes valid poly

* changed invalid style to just stroke

* fixed toolbar bug

* vertexremoved event is now only listened to when allowSelfIntersection is true

* intersection for the cutting polygon is now forbidden

* invalid class is now correctly removed on disable

* handle error when cutting self-intersecting polygons

* resulting layer of cutting now properly inherits options

* just more comments

* added pm:intersect event

* removed console.log

* made cut button snappable by default

* 0.22.0

* added jsfiddle starting point

* fixed some example errors

* added fire, markerdragend and markerdragstart pm events to rectangle. Fixes #245

* removed a console.log

* Added global edit mode toggled event. Fixes #246 (MINOR)

* Added pm:update event. Fixes #229. (MINOR)

* set default _globalRemovalMode to false as promised in #247

* rectangle helpers are hidden when not needed. Fixes #252 (PATCH)

* fix rectangle drawing color bug (#253) (patch)

* Feature/bump deps (#255) (PATCH)

* bump dependencies

* bump dependencies, fix webpack build

* added pm:centerplaced event, fired when the center of a Circle is placed or moved. Fixes #251. (MINOR)

* 0.23.0

* enable babel predets, fix #261 🤞

* minor stuff

* 0.23.1

* added missing step, closes #283

* pm:edit on circles fires after edit, not during. Fixes #285

* hintline style is properly reset after showing error style, fixes #275

* dont start drag on right click, fixes #260

* Redundant coordinate when finish polygon with double click (#281)

* Fixes #147: Redundant coordinate when finish polygon with double click

* Do not remove last vertex on touch interactions since double tap doesn't create an extra vertex.

* demo looks better on mobile now

* minor changes to last PR merge

* add option to disable marker removal during edit. Fixes #258

* eslint fix

* added option to prevent vertex editing in edit mode. Fixes #274

* updated some deps

* Support preferCanvas (#286)

* Added fixes to various modules to account for preferCanvas being set to true on a Leaflet map.

* minor adjustments

* removed comment

* 0.24.0
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

5 participants