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

Uncaught ReferenceError: global is not defined on Agular ^8 #980

Open
5 tasks done
aloksharma1 opened this issue Nov 13, 2019 · 3 comments
Open
5 tasks done

Uncaught ReferenceError: global is not defined on Agular ^8 #980

aloksharma1 opened this issue Nov 13, 2019 · 3 comments

Comments

@aloksharma1
Copy link

aloksharma1 commented Nov 13, 2019

Describe the bug (required)

When using Angular 8, just add ng2-dragula as you normally would and everything works fine till compile but on browser console, i am getting the following error:

Uncaught ReferenceError: global is not defined
    at Object../node_modules/crossvent/node_modules/custom-event/index.js (index.js:2)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/crossvent/src/crossvent.js (crossvent.js:3)
    at __webpack_require__ (bootstrap:79)
    at Object../node_modules/dragula/dragula.js (dragula.js:4)
    at __webpack_require__ (bootstrap:79)
    at Module../node_modules/ng2-dragula/dist/fesm2015/ng2-dragula.js (ng2-dragula.js:1)
    at __webpack_require__ (bootstrap:79)
    at Module../src/app/app.module.ts (app.component.ts:9)
    at __webpack_require__ (bootstrap:79)

To Reproduce (required)

Steps to reproduce the behavior:

  1. Go to 'your angular demo project with latest cli & angular version ^8
  2. add dragula & ng2-dragula to your project
  3. ng serve or npm run start
  4. See error in browser console, project won't run

is this due to ng2-dragula behind the current cli , is there any way i can use it with angular v8 since my project is already most done with newer version.
possibly related to #849 but that thread is talking about angular cli 6 while i am using 8, please suggest the best.

thanks

@gkalpak
Copy link
Contributor

gkalpak commented Nov 14, 2019

Have you added this in your polyfills btw? https://github.com/valor-software/ng2-dragula#1-important-add-the-following-line-to-your-polyfillsts

@sourvil
Copy link

sourvil commented Nov 22, 2019

Hi George, we migrated from Angular 7 to 8 and same error. We already implemented these changes on Angular 7 and it was working. But in Angular 8, with same configuration, it does not work.

And if we use the solution here -->

https://stackoverflow.com/questions/50356408/upgrading-to-angular-6-x-gives-uncaught-referenceerror-global-is-not-defined

We are getting the following message

Error: Zone.js has detected that ZoneAwarePromise (window|global).Promise has been overwritten. Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.) at Function.assertZonePatched (zone-evergreen.js:52) at new NgZone (core.js:39457) at getNgZone (core.js:40708) at PlatformRef.bootstrapModuleFactory (core.js:40523) at core.js:40604 at exceljs.min.js:3

@aipirvu
Copy link

aipirvu commented Jun 12, 2020

This article explains the issue quite well. The link is straight to the problem mentioned by this issue but the entire article can be read as a good to know thing.

https://www.amadousall.com/angular-cli-module-not-found-error-cant-resolve/#related-issue-uncaught-referenceerror-global-is-not-defined

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

4 participants