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

Angular 6 Error: global is not defined #436

Closed
ghost opened this issue Jun 16, 2018 · 5 comments
Closed

Angular 6 Error: global is not defined #436

ghost opened this issue Jun 16, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 16, 2018

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-amplify/amplify-js#678

@DarshanGowda0
Copy link

Was able to reproduce the same issue! Any updates ?

@ghost
Copy link
Author

ghost commented Jun 19, 2018

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

@pyu10055 pyu10055 self-assigned this Jun 19, 2018
@pyu10055
Copy link
Collaborator

Looks like protobuf.js has a fix for this problem, I will update the version. thanks!

@nsthorat
Copy link
Contributor

@ghost and @pyu10055 can you confirm this is fixed in the latest version?

@rthadur
Copy link
Contributor

rthadur commented Mar 20, 2020

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

@rthadur rthadur closed this as completed Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants