-
Notifications
You must be signed in to change notification settings - Fork 518
No ResourceLoader for Angular component templateUrl if URL contains hyphen #1224
Comments
As per my other comment, I'm afraid I wasn't able to reproduce this. If you are still seeing this even with the latest .NET Core 2.0 Angular template, would you be able to post a minimal sample project to GitHub? Otherwise I'm not sure how to proceed with this, as it all seems to work fine when I try. |
Hi @SteveSandersonMS , I'm going to upload a new GitHub repo for this and will share the link shortly along with steps I'm taking to create the project. |
Hello @SteveSandersonMS , I've prepared a GitHub for this and can immediately reproduce the issue : https://github.com/mpalmer-sps/SandboxTemplateUrlIssue My current SDK version (I think) is below: Product Information: Runtime Environment: Microsoft .NET Core Shared Framework Host Version : 2.0.0 Steps I took to setup the project (not including the Git portion):
In both cases an error is displayed as follows: An unhandled exception occurred while processing the request. |
Thanks for providing the repro. I can see what the issue is now. You might find it surprising, but it's this: TheLarkInn/angular2-template-loader#55 Unfortunately
If you remove that line things will start working. It doesn't have anything to do with hyphens. If you want this issue to be fixed, please consider submitting a PR to the |
Thanks Steve! that seems to work, can you provide how you figured that out? |
I had similar the same (similar?) issue and solved it by:
|
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.The text was updated successfully, but these errors were encountered: