Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

JavaScript runtime error: 'Promise' is undefined #575

Closed
yonzo opened this issue Jan 10, 2017 · 4 comments
Closed

JavaScript runtime error: 'Promise' is undefined #575

yonzo opened this issue Jan 10, 2017 · 4 comments

Comments

@yonzo
Copy link

yonzo commented Jan 10, 2017

When generating a solution running "yo aspnetcore-spa" and choosing:

  • Aurelia
  • project.json
  • "My project Name"

...a new application is generated for me.
I can start the application with "dotnet run", and all is good.

But when I open the solution in VS2015 and start the app in debug mode (F5), I get an error saying
Unhandled exception at line 695, column 3 in http://localhost:38523/dist/app.js
and
JavaScript runtime error: 'Promise' is undefined

I can click Continue and open the website as if nothing happened, but I'd really like to make that error go away for my own peace of mind.
Am I doing something wrong, or is it a bug in the template-files (if that's what their called)..?

Regards,
Jon S.

@chris-herring
Copy link

Hi Jon,

You may be using a browser that doesn't support Promises. You could try running in a different browser (latest Chrome works for me) or add the babel-polyfill : https://babeljs.io/docs/usage/polyfill/.

Chris

@yonzo
Copy link
Author

yonzo commented Jan 11, 2017

Hi Chris, and thanks for responding!

Sorry for not mentioning it, but I'm actually using the latest version of Chrome.
I've also tried Edge with the same results.

Another thing I realize I probably should mention, is that it's the Visual Studio debugger that breaks and displays the error. I haven't noticed any errors in the browsers console logs.

Jon

@SteveSandersonMS
Copy link
Member

Are you sure you're really using Chrome or Edge with the Visual Studio debugger? Neither of them are supported by the VS debugger out of the box - it only works directly with Internet Explorer. How have you set up the VS debugger to work with Chrome or Edge?

It seems likely to me that the issue is as @chris-herring describes, which is that the VS debugger is connecting to IE11, and that doesn't contain Promise support without a polyfill. If that is the case, it's certainly a legitimate issue, though it's already being tracked as #484.

Can we close this in favour of #484, or can you confirm exactly how we can repro the issue working with Chrome? As in, what steps should we take to configure VS's debugger to work with it?

@yonzo
Copy link
Author

yonzo commented Jan 16, 2017

You're absolutely right - my apologies!

My current dev. environment is quite new to me (I've been running win8 with IE and Chrome until I started this project), and realize now that the VS debugger is spinning up IE11 and not Edge.

Closing this issue!

Regards,
Jon

@yonzo yonzo closed this as completed Jan 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants