Skip to content

Angular cli webpack prod build error in combination with OpenLayers #12760

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

Closed
ArgV04 opened this issue Oct 26, 2018 · 4 comments
Closed

Angular cli webpack prod build error in combination with OpenLayers #12760

ArgV04 opened this issue Oct 26, 2018 · 4 comments
Labels
freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@ArgV04
Copy link

ArgV04 commented Oct 26, 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
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

macOS - Sierra
node - v8.11.2
npm - 6.3.0
ol - 5.2.0

Angular CLI: 7.0.3
Node: 8.11.2
OS: darwin x64
Angular: 7.0.1
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.10.3
@angular-devkit/build-angular 0.10.3
@angular-devkit/build-optimizer 0.10.3
@angular-devkit/build-webpack 0.10.3
@angular-devkit/core 7.0.3
@angular-devkit/schematics 7.0.3
@angular/cli 7.0.3
@angular/flex-layout 7.0.0-beta.19
@ngtools/.DS_Store
@ngtools/webpack 7.0.3
@schematics/.DS_Store
@schematics/angular 7.0.3
@schematics/update 0.10.3
rxjs 6.3.3
typescript 3.1.3
webpack 4.19.1

Repro steps

The bug occurs when build a prod build including open layers library and "buildOptimizer": set to true in angular.json.

There is already an open ticket in the open layers area which describes the issue: openlayers/openlayers#8815
But I don't know right if it's there the right place or better here?

The log given by the failure

Stack trace see here too: openlayers/openlayers#8815

Desired functionality

Use case is using of open layers map with Angular 7.0.x :) in production mode

Mention any other details that might be useful

@ngbot ngbot bot added this to the needsTriage milestone Oct 26, 2018
@alan-agius4 alan-agius4 added the freq1: low Only reported by a handful of users who observe it rarely label Oct 26, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Nov 1, 2018
@fredj
Copy link

fredj commented Nov 7, 2018

In a nutshell, OpenLayers defines a function and calls it to initialize the module:
https://github.com/openlayers/openlayers/blob/7321541de83db157de38417cc83e32bd3eca397d/src/ol/proj.js#L495-L510

Because no code imports this addCommon function, the code (and the call) are removed from the build.

@clydin
Copy link
Member

clydin commented Nov 7, 2018

That in itself is not a problem. The issue here is that the package has identified itself as being side effect free in its package.json when it appears it is not.

@clydin
Copy link
Member

clydin commented Nov 7, 2018

Closing as the CLI is acting appropriately based on the information it is given from the package.

@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 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants