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.

Angular 6 Error: global is not defined

See original GitHub issue

To get help from the community, check out our Google group.

TensorFlow.js version

0.11.6

Browser version

Version 67.0.3396.87 (Official Build) (64-bit)

Describe the problem or feature request

Tensorflow.js used in an Angular 6 app throws Error:

Uncaught ReferenceError: global is not defined at Object../node_modules/protobufjs/src/util/minimal.js (minimal.js:49) at __webpack_require__ (bootstrap:76) at Object../node_modules/protobufjs/src/writer.js (writer.js:4) at __webpack_require__ (bootstrap:76) at Object../node_modules/protobufjs/src/index-minimal.js (index-minimal.js:13) at __webpack_require__ (bootstrap:76) at Object../node_modules/protobufjs/minimal.js (minimal.js:4) at __webpack_require__ (bootstrap:76) at Object../node_modules/@tensorflow/tfjs-converter/dist-es6/data/compiled_api.js (compiled_api.js:1) at __webpack_require__ (bootstrap:76)

Code to reproduce the bug / link to feature request

To reproduce:

import * as tf from '@tensorflow/tfjs'; ... linearModel: tf.Sequential; ... this.linearModel = tf.sequential();

I have passed through this issue with adding these lines on my index.html head:

<script> if (global === undefined) { var global = window; } </script>

aws/aws-amplify#678

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
ghostcommented, Jun 19, 2018

As reported on aws/aws-amplify#678, this Stack overflow an answer might helps, https://stackoverflow.com/questions/50371593/angular-6-uncaught-referenceerror-buffer-is-not-defined/50377270#50377270

0reactions
rthadurcommented, Mar 20, 2020

Closing this due to lack of activity, feel to reopen. Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Angular 6: Uncaught ReferenceError: global is not defined #81
I'm getting a similar error on, but "document is not defined", on Angular 6 with SSR, as soon as I include the package....
Read more >
index.js:43 uncaught referenceerror: global is not defined
Bug report. Following #8160 I found that it is still possible to cause the global ist not defined error without installing a library...
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 >
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? // vite....
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