You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a file named with the extension: *.cshtml.js (e.g., index.cshtml.js) into the wwwroot directory.
Build
Description of the problem:
Prior to net6 several web projects were setup to use generating cshtml page javascript using typescript. To keep files together and use the VS file nesting feature typescript files were named with the corresponding page filename (e.g., index.cshtml.ts) which would output index.cshtml.js.
Expected behavior:
No errors
Actual behavior:
Results in a build error BLAZOR106 associated with the static file
error BLAZOR106: The JS module file '..\wwwroot\Index.cshtml.js' was defined but no associated razor component or view was found for it.
Logs
OmniSharp
No OmniSharp, using C# DevKit
Razor
Expand
[Client - 7:58:23 AM] -- Starting Issue Data Collection--
[Client - 7:58:34 AM] -- Stopping Issue Data Collection--
Yes and no, I have not tried again lately, the workaround is to rename the file in question to not have a double extension (.cshtml.js.). However, while dropping the ".cshtml." from the extension prevents the compiler error, it also eliminates the ability to nest the files.
As far as I am aware .NET it still produces the same error.
We're seeing on blazor components as well after we added a lib.module.js file to a repository.
The whole Blazor + TS story seems to be a bit damaged...
Is this a Bug or Feature request?:
Bug
Steps to reproduce:
Description of the problem:
Prior to net6 several web projects were setup to use generating cshtml page javascript using typescript. To keep files together and use the VS file nesting feature typescript files were named with the corresponding page filename (e.g., index.cshtml.ts) which would output index.cshtml.js.
Expected behavior:
No errors
Actual behavior:
Results in a build error BLAZOR106 associated with the static file
Logs
OmniSharp
No OmniSharp, using C# DevKit
Razor
Expand
Workspace information
Razor document:
Expand
Projected CSharp document:
Expand
Projected Html document:
Expand
Machine information
VSCode version: 1.92.0
Razor.VSCode version: 2.39.29
dotnet --info
Expand
Extensions
Expand
The text was updated successfully, but these errors were encountered: