question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Global is not defined

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
SarathkumarMScommented, Jul 25, 2018

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)

2reactions
noman115pkcommented, Sep 5, 2018

@SarathkumarMS This solution works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught ReferenceError: global is not defined #2141
ncaught ReferenceError : global is not defined at Object../node_modules/buffer/index.js (index.js:43) at webpack_require (bootstrap:76)
Read more >
How to fix the ReferenceError: global is not defined error in ...
That sound simple enough to fix, just create a vite. config. [js/ts] file, add it to your SvelteKit project and define global right?...
Read more >
Upgrading to angular-6.x gives "Uncaught ReferenceError
Then you're getting the following error Fix: "Uncaught ReferenceError: global is not defined" do it as follows node: { global: true, ...
Read more >
Uncaught ReferenceError: global is not defined - YouTube
Uncaught ReferenceError: global is not defined at node_modules/@walletconnect/socket-transport/dist/esm/index.jscreate a n ew filw named ...
Read more >
react global is not defined - You.com | The AI Search ...
Installing and importing react-dates results in this error: Uncaught ReferenceError: global is not defined since react-dates has some dependencies that use ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found