Global is not defined
See original GitHub issueI get this error when using angular-formio: 2.0.0-alpha.2 in angular 6.0.0-rc.4.
Uncaught ReferenceError: global is not defined at Object../node_modules/formiojs/lib/formio.js (formio.js:1382) at __webpack_require__ (bootstrap:74) at Object../node_modules/formiojs/lib/formio.form.js (formio.form.js:23) at __webpack_require__ (bootstrap:74) at Object../node_modules/formiojs/lib/index.js (index.js:8) at __webpack_require__ (bootstrap:74) at Object../node_modules/angular-formio/formio.service.js (formio.service.js:1) at __webpack_require__ (bootstrap:74) at Object../node_modules/angular-formio/index.js (formio.service.js:112) at __webpack_require__ (bootstrap:74) at Object../src/app/app.module.ts (app.component.ts:8) at __webpack_require__ (bootstrap:74) at Object../src/main.ts (environment.ts:17) at __webpack_require__ (bootstrap:74) at Object.0 (main.ts:14) at __webpack_require__ (bootstrap:74) at checkDeferredModules (bootstrap:43) at Array.webpackJsonpCallback [as push] (bootstrap:30) at main.js:1 15:56:27.559
This is the line it points to:
// Support ES5 require and globals. module.exports = global.Formio = Formio; exports.default = Formio;
If you try to reproduce make sure to change
import { Observable} from 'rxjs/Observable'
to
import { Observable} from 'rxjs'
.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:6 (1 by maintainers)
Top GitHub Comments
I found a solution for this issue, actually this error caused from another node_module package ‘crossvent’ So please add
(window as any).global = window;
to polyfills.ts (add at the top)@SarathkumarMS This solution works.