Open
Description
I'm using these library versions:
ReactJS.NET
: 5.2.12JavaScriptEngineSwitcher
: 3.17.4
Runtime environment:
- OS: Linux (Ubuntu 20.04)
- .NET Version: 6
Steps to reproduce
- Use this code
app.UseReact(configuration =>
{
configuration
.AddScriptWithoutTransform("/foo/bar/react.js");
});
- Deploy to a machine running Linux OS
Actual
ReactScriptLoadException: Could not find a part of the path '<webroot>/foo/bar/react.js'
Expected
No exception thrown
More info
- Works fine on Windows, only reproducible on Linux
- Due to some technical limitations, I cannot place Webpack bundle in WebRoot directory
Workaround
Add \\
at the beginning of the path:
app.UseReact(configuration =>
{
configuration
.AddScriptWithoutTransform("\\/foo/bar/react.js");
});
Root Cause
On Linux,
TrimStart('/')
is a destructive commandMetadata
Metadata
Assignees
Labels
No labels