angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Cannot set property 'stack' of undefined

Open sprider opened this issue 9 years ago • 25 comments

OS?

Windows 7

Versions.

v6.9.2

Repro steps.

Yes, Auth0 implementation

Hi,

I am new to angularjs 2. Any idea about this error?

error

sprider avatar Jan 12 '17 22:01 sprider

@sprider can you please give some more information about the version you are using and the repro steps? For instance which steps you took to implement Auth0?

beeman avatar Jan 12 '17 23:01 beeman

@sprider so there seems to be a bug in zone.js. Try fixing the version to 0.7.2 and see if the error message is more explicit

deebloo avatar Jan 12 '17 23:01 deebloo

@deebloo thanks thats working for me.

scttcper avatar Jan 12 '17 23:01 scttcper

I can confirm that I have the issue too on 1.0.0-beta.25, freshly installed app with ng new.

Downgrading zone.js one minor version seems to fix it: npm install --save [email protected]

beeman avatar Jan 13 '17 03:01 beeman

npm install --save [email protected] fixed the problem for me

Thank you guys

sprider avatar Jan 13 '17 05:01 sprider

I can also confirm that [email protected] fixed the problem

OS?

macOS Sierra 10.12.2

Versions.

angular-cli: 1.0.0-beta.24 node: 6.9.1 os: darwin x64 @angular/common: 2.4.3 @angular/compiler: 2.4.3 @angular/core: 2.4.3 @angular/forms: 2.4.3 @angular/http: 2.4.3 @angular/platform-browser: 2.4.3 @angular/platform-browser-dynamic: 2.4.3 @angular/router: 3.4.3 @angular/compiler-cli: 2.4.3

The log given by the failure.

TypeError: Cannot set property 'stack' of undefined at SyntaxError.set [as stack] (webpack:///~/@angular/compiler/src/facade/errors.js:64:31 <- src/test.ts:55573:61) at assignAll (webpack:///~/zone.js/dist/zone.js:704:0 <- src/test.ts:71100:29) at SyntaxError.ZoneAwareError (webpack:///~/zone.js/dist/zone.js:775:0 <- src/test.ts:71171:16) at SyntaxError.BaseError [as constructor] (webpack:///~/@angular/compiler/src/facade/errors.js:26:0 <- src/test.ts:55535:16) at new SyntaxError (webpack:///~/@angular/compiler/src/util.js:151:0 <- src/test.ts:5508:16) at DirectiveNormalizer.normalizeLoadedTemplate (webpack:///~/@angular/compiler/src/directive_normalizer.js:127:0 <- src/test.ts:13379:19) at DirectiveNormalizer.normalizeTemplateSync (webpack:///~/@angular/compiler/src/directive_normalizer.js:104:0 <- src/test.ts:13356:21) at DirectiveNormalizer.normalizeTemplate (webpack:///~/@angular/compiler/src/directive_normalizer.js:81:0 <- src/test.ts:13333:43) at CompileMetadataResolver._loadDirectiveMetadata (webpack:///~/@angular/compiler/src/metadata_resolver.js:207:29 <- src/test.ts:14575:75) at webpack:///~/@angular/compiler/src/metadata_resolver.js:383:33 <- src/test.ts:14751:54 at Array.forEach (native) at CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata (webpack:///~/@angular/compiler/src/metadata_resolver.js:382:0 <- src/test.ts:14750:41) at webpack:///~/@angular/compiler/src/jit/compiler.js:170:0 <- src/test.ts:39012:58 at Array.forEach (native) at JitCompiler._loadModules (webpack:///~/@angular/compiler/src/jit/compiler.js:169:0 <- src/test.ts:39011:43) TypeError: Cannot read property 'detectChanges' of undefined at Object. (webpack:///src/app/banner/banner-inline.component.spec.ts:28:12 <- src/test.ts:72233:16) at ZoneDelegate.invoke (webpack:///~/zone.js/dist/zone.js:242:0 <- src/test.ts:70638:26) at ProxyZoneSpec.onInvoke (webpack:///~/zone.js/dist/proxy.js:79:0 <- src/test.ts:51715:39) at ZoneDelegate.invoke (webpack:///~/zone.js/dist/zone.js:241:0 <- src/test.ts:70637:32) at Zone.run (webpack:///~/zone.js/dist/zone.js:113:0 <- src/test.ts:70509:43) at Object. (webpack:///~/zone.js/dist/jasmine-patch.js:102:0 <- src/test.ts:51430:34) at ZoneQueueRunner.jasmine.QueueRunner.ZoneQueueRunner.execute (webpack:///~/zone.js/dist/jasmine-patch.js:132:0 <- src/test.ts:51460:42)

goto1 avatar Jan 13 '17 17:01 goto1

Reverting to [email protected] fixed this problem (^0.7.4) Zone.js was referred earlier in package.json as ~0.7.4.

snarun avatar Jan 14 '17 19:01 snarun

[email protected] really prevents Angular to display error message. Downgrading zone.js to version 0.7.4 helps.

luozt avatar Jan 15 '17 11:01 luozt

Downgrading advice to 0.7.2 helped me. Thanks!

guneybilen avatar Jan 15 '17 13:01 guneybilen

same error ü

elvisbegovic avatar Jan 16 '17 14:01 elvisbegovic

Downgrading to 0.7.4 helped - 0.7.5 obscured it

rodneyjoyce avatar Jan 16 '17 15:01 rodneyjoyce

Same error.

Downgrading to 0.7.2 caused : 'Uncaught TypeError: Cannot set property stack of [object Object] which has only a getter' with Angular #427 zone.js issue

My packages :

  • "dependencies": {
  • "@angular/common": "^2.4.3",
  • "@angular/compiler": "^2.4.3",
  • "@angular/core": "^2.4.3",
  • "@angular/forms": "^2.4.3",
  • "@angular/http": "^2.4.3",
  • "@angular/platform-browser": "^2.4.3",
  • "@angular/platform-browser-dynamic": "^2.4.3",
  • "@angular/router": "^3.4.3",
  • "core-js": "^2.4.1",
  • "rxjs": "^5.0.1",
  • "ts-helpers": "^1.1.1",
  • "zone.js": "^0.7.4"
  • },
  • "devDependencies": {
  • "@angular/compiler-cli": "^2.4.3",

MatGhp avatar Jan 17 '17 08:01 MatGhp

I got the same error earlier today.

It was generated because I failed to import a module (ReactiveFormsModule) in my app.module file.

Ensure you import every dependency in your app.module.

Cheers!

aatinubu avatar Jan 17 '17 09:01 aatinubu

The issue has been fixed in zone.js version 0.7.6.

npm install --save [email protected] should fix this, and new apps created with ng new or ng init are now work out of the box again :)

beeman avatar Jan 18 '17 01:01 beeman

Upgrading to ^0.7.6 worked !! Thank you!

snarun avatar Jan 18 '17 21:01 snarun

npm install --save [email protected] fixed the problem for me

Thank you guys!

bluehenry avatar Jan 19 '17 03:01 bluehenry

I feel like this needs to be reopened. Certain errors are still obscured. I am getting an error that reads when using ^0.7.6

Error: Uncaught (in promise): Error: DI Error

when using [email protected] is reads

Error: Uncaught (in promise): Error: No provider for RouterExtendedService!

which of course is much more helpful

Germcguire87 avatar Jan 19 '17 19:01 Germcguire87

@Germcguire87 I actually think that is an issue that should be opened here https://github.com/angular/zone.js as angular-cli can not change that behavior.

beeman avatar Jan 19 '17 19:01 beeman

switching to zone.js 0.7.4 solved my problem thank you @sprider

bardiarastin avatar Jan 21 '17 11:01 bardiarastin

You guys rock. This worked for me

CaliThemanDC avatar Jan 25 '17 17:01 CaliThemanDC