No ResourceLoader for Angular component templateUrl if URL contains hyphen #475

Closed
opened 2025-08-09 17:16:26 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @mpalmer-sps on 8/24/2017

I am using the SPAtemplates outlined in this blog and just updated to .NetCore 2 because the templates no longer appear unless you update: "https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/" with Visual Studio 2017.

The behavior I'm seeing is that once the TS file references an HTML TemplateURL file from with a hyphen in the name the error: "NodeInvocationException: No ResourceLoader implementation has been provided. Can't read the url "whatever-whatever.component.html""

Despite deleting and recreating the files this error persists but that may be some form of caching - I have yet to exhaust all options after deleting.

Switching to a standard inline template works but this breaks whenever a templateUrl is used (even if you rename the file and remove the hyphen). Creating a new component with a new html display template without a hyphen works well. So this is very easy to reproduce.

Is there anything that can be checked? Keep in mind that I've not modified the csproj file in any way - just adding new components so the <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> is still there and there are no "extra" js or map files.

*Originally created by @mpalmer-sps on 8/24/2017* I am using the SPAtemplates outlined in this blog and just updated to .NetCore 2 because the templates no longer appear unless you update: "https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/" with Visual Studio 2017. The behavior I'm seeing is that once the TS file references an HTML TemplateURL file from with **a hyphen in the name** the error: "NodeInvocationException: No ResourceLoader implementation has been provided. Can't read the url "whatever-whatever.component.html"" Despite deleting and recreating the files this error persists but that may be some form of caching - I have yet to exhaust all options after deleting. Switching to a standard inline template works but this breaks whenever a templateUrl is used (even if you rename the file and remove the hyphen). Creating a new component with a new html display template without a hyphen works well. So this is very easy to reproduce. Is there anything that can be checked? Keep in mind that I've not modified the csproj file in any way - just adding new components so the `<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>` is still there and there are no "extra" js or map files.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#475
No description provided.