{"action":"opened","issue":{"url":"https://api.github.com/repos/openlayers/openlayers/issues/8859","repository_url":"https://api.github.com/repos/openlayers/openlayers","labels_url":"https://api.github.com/repos/openlayers/openlayers/issues/8859/labels{/name}","comments_url":"https://api.github.com/repos/openlayers/openlayers/issues/8859/comments","events_url":"https://api.github.com/repos/openlayers/openlayers/issues/8859/events","html_url":"https://github.com/openlayers/openlayers/issues/8859","id":373804125,"node_id":"MDU6SXNzdWUzNzM4MDQxMjU=","number":8859,"title":"Prod build does not work with optimization: true","user":{"login":"JulidaRocks","id":39371377,"node_id":"MDQ6VXNlcjM5MzcxMzc3","avatar_url":"https://avatars0.githubusercontent.com/u/39371377?v=4","gravatar_id":"","url":"https://api.github.com/users/JulidaRocks","html_url":"https://github.com/JulidaRocks","followers_url":"https://api.github.com/users/JulidaRocks/followers","following_url":"https://api.github.com/users/JulidaRocks/following{/other_user}","gists_url":"https://api.github.com/users/JulidaRocks/gists{/gist_id}","starred_url":"https://api.github.com/users/JulidaRocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulidaRocks/subscriptions","organizations_url":"https://api.github.com/users/JulidaRocks/orgs","repos_url":"https://api.github.com/users/JulidaRocks/repos","events_url":"https://api.github.com/users/JulidaRocks/events{/privacy}","received_events_url":"https://api.github.com/users/JulidaRocks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-25T07:13:32Z","updated_at":"2018-10-25T07:13:32Z","closed_at":null,"author_association":"NONE","body":"We are using \r\n\r\n```\r\n\"ol\": \"^5.2.0\",\r\n\"ol-geocoder\": \"^3.2.0\",\r\n\"ol-popup\": \"^4.0.0\"\r\n```\r\n\r\nwith Angular 7.  Works fine in dev mode, but leeds to the following error when using prod build and optimization: true:\r\n\r\n> ERROR TypeError: Cannot read property 'getExtent' of null\r\n    at 3.js:1\r\n    at e.applyOptions_ (3.js:1)\r\n    at new e (3.js:1)\r\n    at l.initOpenLayerMap (11.js:1)\r\n    at l.ngOnInit (11.js:1)\r\n    at main.js:1\r\n    at main.js:1\r\n    at _s (main.js:1)\r\n    at Vs (main.js:1)\r\n    at Object.updateDirectives (11.js:1)\r\n\r\nCode snippet:\r\n\r\n```\r\nimport OlTileLayer from 'ol/layer/Tile';\r\nimport OlMap from 'ol/Map';\r\nimport OlView from 'ol/View';\r\nimport OlOsmSource from 'ol/source/OSM';\r\nimport Geocoder from 'ol-geocoder/dist/ol-geocoder';\r\nimport OlPopup from 'ol-popup';\r\n\r\ninitOpenLayerMap() {\r\n    const olview = new OlView({ center: [0, 0], zoom: 2 }),\r\n      baseLayer = new OlTileLayer({ source: new OlOsmSource() }),\r\n      map = new OlMap({\r\n        target: document.getElementById('map'),\r\n        view: olview,\r\n        layers: [baseLayer]\r\n      });\r\n\r\n    const popup = new OlPopup();\r\n    map.addOverlay(popup);\r\n\r\n    const geocoder = new Geocoder('nominatim', {\r\n      provider: 'osm',\r\n      lang: 'de-DE',\r\n      placeholder: 'Wohnort suchen...',\r\n      limit: 5,\r\n      debug: false,\r\n      autoComplete: true,\r\n      keepOpen: false\r\n    });\r\n    map.addControl(geocoder);\r\n\r\n    geocoder.on('addresschosen', this.setResidenceForm());\r\n  }\r\n```\r\n\r\nTemplate snippet:\r\n```\r\n<div mat-dialog-content>\r\n  <div id=\"map\" class=\"map\"></div>\r\n  <div id=\"popup\"></div>\r\n</div>\r\n```\r\n\r\nWe also use the ol map to show locations at another component of the app that also leeds to the same error.\r\n\r\nAny ideas?\r\nThanks a lot"}}
{"actor":{"display_login":"JulidaRocks"}}