Any environment other than development fails to load JavaScript resources
See original GitHub issueDescribe the bug
When specifying ASPNETCORE_ENVIRONMENT as a value other than development, you get 404 errors for the ChartJs _content resources.
Which Blazor project type is your bug related to?
- Server-Side
Which charts does this bug apply to?
all charts
To Reproduce
Steps to reproduce the behavior:
- Using this version of ChartJSBlazor ‘1.1.0’.
- With this code.
- Run
ASPNETCORE_ENVIRONMENT=production dotnet runfrom the project root, or use the VSCode run task in the sample project - See error.
Expected behavior
The scripts load successfully
Screenshots
Additional context / logging
[2020-06-14T14:50:17.862Z] Information: Normalizing '_blazor' to 'https://localhost:5001/_blazor'. blazor.server.js:1:5212
Loading failed for the <script> with source “https://localhost:5001/_content/ChartJs.Blazor/moment-with-locales.min.js”. localhost:5001:76:1
Loading failed for the <script> with source “https://localhost:5001/_content/ChartJs.Blazor/Chart.min.js”. localhost:5001:79:1
Loading failed for the <script> with source “https://localhost:5001/_content/ChartJs.Blazor/ChartJsBlazorInterop.js”. localhost:5001:82:1
[2020-06-14T14:50:18.046Z] Information: WebSocket connected to wss://localhost:5001/_blazor?id=FHaTttdw29shyxT33frTkQ. blazor.server.js:1:5212
[2020-06-14T14:50:18.462Z] Error: There was an unhandled exception on the current circuit, so this circuit will be terminated. For more details turn on detailed exceptions by setting 'DetailedErrors: true' in 'appSettings.Development.json' or set 'CircuitOptions.DetailedErrors'. blazor.server.js:15:27309
[2020-06-14T14:50:18.464Z] Information: Connection disconnected. blazor.server.js:1:5212
Code example
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
Cannot find JS files -- Failed to load resource: the server ...
1 Answer 1 ... Scripts folder should be inside the wwwroot folder in order for the server to find them. To serve static...
Read more >Custom JavaScript not working across all environments for ...
The weird thing is that this works perfectly fine in our Development Environment but doesn't on any of the other environments.
Read more >Failing to load JavaScript
I just uploaded a website from GitHub. On my local environment, it works fine but once I uploaded it to Netlify, the buttons...
Read more >Application Insights JavaScript SDK troubleshooting
Learn how to troubleshoot SDK load failure for JavaScript web applications, Azure Application Insights for web pages, and source map support ...
Read more >Handling common JavaScript problems - MDN Web Docs
Maybe not so simple, but this article should at least give you a start, and some ideas on how to tackle the JavaScript-related...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yeah that’s right, everything’s taken from the readme, no further changes were made.
Awesome, thank you 👍