openlayers: ol3 is not usable with webpack.

It seems that openlayers should work when required from npm (I’m making this assumption because some key tickets related to npm were resolved and released - #3039, #3071).

But it doesn’t work… I’m installing openlayers package from npm and then require it with require('openlayers'), but as a result I’m getting Uncaught TypeError: Cannot read property 'protocol' of undefined exception. It seems that for some reason goog.global.location is undefined.

Any ideas?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 28 (14 by maintainers)

Most upvoted comments

@tcoopman didn’t know about that dependency. I was trying to run my tests in node with jsdom. Probably I need add karma to my project. Thanks!