Skip to content

Asset manifest handling and non-root webapplications #1134

@aldrashan

Description

@aldrashan

I'm using these library versions:

  • ReactJS.NET: 5.2.4
  • JavaScriptEngineSwitcher: ChakraCore 3.5.6
  • react and react-dom: N/A
  • webpack: N/A
  • node: N/A

Runtime environment:

  • OS: Windows server 2016 64 bit
  • .NET Framework 4.7.2

Steps to reproduce

Our internal application is hosted at https://[OUR_BASE_URL]/[REACT_APPLICATION_NAME], with another webapplication being hosted at https://[OUR_BASE_URL].

I've followed the tutorial and have implemented the Asset manifest handling step.
Everything works while using localhost, but scripts can't be found on the production website after publishing the application.
Scripts and stylesheets are generated relative to https://[OUR_BASE_URL]/ instead of https://[OUR_BASE_URL]/[REACT_APPLICATION_NAME]/ (e.g. <script src="/dist/main.f9cc162b.js"></script> instead of <script src="/[REACT_APPLICATION_NAME]/dist/main.f9cc162b.js"></script>).
Seems like the ~ in SetReactAppBuildPath("~/dist") isn't properly being converted to [REACT_APPLICATION_NAME] like it does for <script src="~/js/site.js"></script> inside the _Layout.cshtml.

I've found threads that say you have to specify "homepage": "." or "./" inside package.json, but this doesn't seem to be doing anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions