Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
I have a Razor Class Library (RCL) that includes a TypeScript file for JavaScript interop. When the TypeScript compiles into a JavaScript file and outputs it to the wwwroot directory, the generated JavaScript file is not found when using the component and getting 404 notfound error, after migrating to .NET 9. Also tried #57662
I configured the TS with tsconfig.json
, then I tried the MSBuild options in the csproj even though added the following configuration to the file, i encounter the same issue:
<PropertyGroup>
<TypeScriptOutFile>wwwroot\example.js</TypeScriptOutFile>
<TypeScriptTarget>ES2016</TypeScriptTarget>
<TypeScriptAlwaysStrict>true</TypeScriptAlwaysStrict>
<TypeScriptInclude>Interop\*.ts</TypeScriptInclude>
<PrepareForBuildDependsOn>
CompileTypeScript;
GetTypeScriptOutputForPublishing;$(PrepareForBuildDependsOn)
</PrepareForBuildDependsOn>
<TypeScriptSourceMap>false</TypeScriptSourceMap>
</PropertyGroup>
Surprisingly, when i include the TS source map with <TypeScriptSourceMap>true</TypeScriptSourceMap>
it works, but will serve the TS file too.
Expected Behavior
The js file should be included in the `_content/MyComponent/example.js".
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
.NET 9
Anything else?
No response