Closed
Description
Bug Report or Feature Request (mark with an x
)
- [X] bug report -> please search issues before submitting
- [ ] feature request
Versions.
Angular CLI: 1.5.0-rc.3
Node: 8.7.0
OS: win32 x64
Angular: 4.4.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, tsc-wrapped, upgrade
@angular/cdk: 2.0.0-beta.12
@angular/cli: 1.5.0-rc.3
@angular/flex-layout: 2.0.0-beta.9
@angular/material: 2.0.0-beta.12
@angular-devkit/build-optimizer: 0.0.30
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0-rc.3
@schematics/angular: 0.0.48
typescript: 2.3.4
webpack: 3.8.1
Repro steps.
create angular/cli project
add dependency and import socket.io-client@2.0.4
ng serve --aot
open browser
The log given by the failure.
index.js:10 Uncaught ReferenceError: global is not defined
at eval (index.js:10)
at Object.../../../../has-binary2/index.js (vendor.bundle.js:2914)
at __webpack_require__ (inline.bundle.js:55)
at eval (index.js:8)
at Object.../../../../socket.io-parser/index.js (vendor.bundle.js:9569)
at __webpack_require__ (inline.bundle.js:55)
at eval (index.js:7)
at Object.../../../../socket.io-client/lib/index.js (vendor.bundle.js:9527)
at __webpack_require__ (inline.bundle.js:55)
at eval (io-service.ts:1)
Activity
dottodot commentedon Oct 24, 2017
I seeing the same issue as well with
ng-socket-io
but also withimport 'intl';
inpolyfills.ts
amitport commentedon Oct 24, 2017
(window as any).global = window;
topollyfils.ts
, but it didn't work.1.5.0-rc.1
workeddottodot commentedon Oct 24, 2017
Strange I've reverted to
1.5.0-rc.2
and still get it, no idea what's going on.amitport commentedon Oct 24, 2017
@dottodot
oh sorry, I actually reverted to
1.5.0-rc.1
in any case, make sure it's a clean revert. try deleting node_modules and packge/yarn-lock before
npm i
dottodot commentedon Oct 24, 2017
Thanks that worked. I've gone back to
1.5.0-rc.2
and that's ok for me so seems like the issue is in1.5.0-rc.3
Martin-Luft commentedon Oct 24, 2017
Same problem here since
1.5.0-rc.3
, with1.5.0-rc.2
no problems...robisim74 commentedon Oct 25, 2017
Same error using rc.3 Uncaught ReferenceError: global is not defined also importing another library (jsrsasing). It worked fine until rc.2.
RicardoVaranda commentedon Oct 25, 2017
Hi guys, could you please provide a simple repo of this issue, that way it's easier and faster for the team to be able to debug the issue.
dottodot commentedon Oct 25, 2017
@RicardoVaranda https://github.com/dottodot/ang5-test
All i've done is create a new project with 1.5.0-rc.3 and included
import 'intl';
in polyfills.ts and you get the errorfilipesilva commentedon Oct 25, 2017
This is definitely related to #8132 as we've removed the node
global
object from the compilation environment. I'm investigating what can be done about it.52 remaining items