turf icon indicating copy to clipboard operation
turf copied to clipboard

Angular 9 Missing global reference

Open dartdl opened this issue 5 years ago • 6 comments

Please provide the following when reporting an issue: when adding @turf as a part of a Angular 9 project we get the following error.

errors.ts:30 ERROR Error: Uncaught (in promise): ReferenceError: global is not defined ReferenceError: global is not defined at Object../node_modules/has-symbols/index.js (index.js:3) at __webpack_require__ (bootstrap:84) at Object../node_modules/es-abstract/GetIntrinsic.js (GetIntrinsic.js:39) at __webpack_require__ (bootstrap:84) at Object../node_modules/es-abstract/helpers/callBind.js (callBind.js:5) at __webpack_require__ (bootstrap:84) at Object../node_modules/object-is/index.js (index.js:4) at __webpack_require__ (bootstrap:84) at Object../node_modules/deep-equal/index.js (index.js:3) at __webpack_require__ (bootstrap:84) at Object../node_modules/geojson-equality/index.js (index.js:2) at __webpack_require__ (bootstrap:84) at Module../node_modules/@turf/boolean-overlap/main.es.js (main.es.js:1) at __webpack_require__ (bootstrap:84) at Module../node_modules/@turf/turf/index.js (index.js:1) at resolvePromise (zone-evergreen.js:798) [angular] at resolvePromise (zone-evergreen.js:750) [angular] at :4200/polyfills.7b850002e03099b08e07.js:920:21 [angular] at Object.onInvokeTask (ng_zone.ts:293) [angular] at drainMicroTaskQueue (zone-evergreen.js:569) [<root>]

this is because Angular is not providing a global variable anymore

dartdl avatar May 07 '20 16:05 dartdl

Which version of turf are you using?

rowanwins avatar May 07 '20 22:05 rowanwins

This concerns any version using geojson-equality. See https://github.com/inspect-js/has-symbols/issues/11

mistic100 avatar Feb 11 '21 08:02 mistic100

We can probably bump geojson-equality's deep-equal dependency to ^2.0.5

mfedderly avatar Aug 02 '21 20:08 mfedderly

Any solution for this? We have the same problem...

bttb avatar Jan 25 '22 16:01 bttb