Angular 6 Error: global is not defined
See original GitHub issueTo 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:
- Created 5 years ago
- Comments:5
Top GitHub Comments
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
Closing this due to lack of activity, feel to reopen. Thank you