-
Notifications
You must be signed in to change notification settings - Fork 516
[QUESTION] Cannot resolve symbol 'require' #322
Comments
Hey @rbasniak
This is pulling in Type definitions for all things ES6 and DOM related. Things which are now bundled with TypeScript, instead of separate definitions. Hope that helps! |
|
@MarkPieszak @SteveSandersonMS I manually updated TS extension on VS to 2.0 but the 'require' wasn't being indentified yet. It turns out that it was Resharper who was complaining about it, if I disable Resharper then I get no errors on the 'require' statement. Thank you both for these detailed explanations, specially about the typings, I wasn't aware that TS 2.0 changed that much. |
Hi,
I'm a developer with pure desktop background and I'm starting to learn web development now with ASP.NET Core and Angular 2, so please forgive me if this is a stupid question =)
I downloaded this new updated version for Angular 2 final and I'm getting an error on all component files telling me that it 'Cannot resolve symbol require' on the template: require('./name.component.html').
Other projects I came across use typings and to resolve such errors I just drag the index.d.ts from the typings folder to my AppModule and unresolved names errors go away.
But this new version does not use typings. Based on this I would like to ask 3 questions:
Is there any way to remove the error on the require symbol? Application is running and working, it's just that's this is annoying.
Why is the require required? Why I can't just use templateUrl instead with the filename?
On all other tutorials I port to Asp.Net Core if I didn't reference the index.d.ts from the typings folder I get a lot of errors of unresolved symbols, like Promisse, Map, etc. But this does not happens with your Angular 2 template. Where are the typings definitions coming from?
By the way, great job with this project!!! Also this is the first and only setup I could replicate on a blank project using Angular and Webpack... Really thanks!
The text was updated successfully, but these errors were encountered: