Skip to content

fix: Update service worker to fetch dotnet.js instead of dotnet.boot.js for .NET 10 - #1004

Merged
jeromelaban merged 7 commits into
mainfrom
copilot/fix-service-worker-error
Nov 19, 2025
Merged

jeromelaban merged 7 commits into
mainfrom
copilot/fix-service-worker-error

Conversation

Copilot AI commented Nov 18, 2025 •

Copy link
Copy Markdown
Contributor

In .NET 10, dotnet.boot.js was merged into dotnet.js for performance. The service worker still attempted to fetch the non-existent file, causing a 404 error when PWA is enabled.

Changes

  • service-worker.js: Changed fetch target from _framework/dotnet.boot.js to _framework/dotnet.js
  • ShellTask.cs: Updated offline files manifest to reference dotnet.js instead of dotnet.boot.js, and fixed uno-config.js path to include {PackageAssetsFolder}/ prefix for correct PWA caching
  • CI Scripts: Updated all .NET SDK versions from preview builds to stable 10.0.100 release in .github/workflows/ci.yml and build/ci/dotnet-install.yml

The boot configuration extraction logic (regex matching /*json-start*/ and /*json-end*/ markers) remains unchanged, as the format is identical between files.

Warning

<issue_title>[ServiceWorker] Error processing blazor.boot.json: Failed to fetch dotnet.boot.js: 404</issue_title>
<issue_description>### Current behavior 🐛

When PWA is enabled, the service worker shows the following error message:

[ServiceWorker] Error processing blazor.boot.json: Failed to fetch dotnet.boot.js: 404 

This is expected as in net10, this file does not exist anymore.

Expected behavior 🎯

No error message.

How to reproduce it (as minimally and precisely as possible) 🔬

No response

Workaround 🛠️

No response

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

No response

Uno.Sdk version (and other relevant versions) 📦

10.0.10

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

No response</issue_description>

Comments on the Issue (you are @copilot in this section)

Original prompt

This section details on the original issue you should resolve

<issue_title>[ServiceWorker] Error processing blazor.boot.json: Failed to fetch dotnet.boot.js: 404</issue_title>
<issue_description>### Current behavior 🐛

When PWA is enabled, the service worker shows the following error message:

[ServiceWorker] Error processing blazor.boot.json: Failed to fetch dotnet.boot.js: 404 

This is expected as in net10, this file does not exist anymore.

Expected behavior 🎯

No error message.

How to reproduce it (as minimally and precisely as possible) 🔬

No response

Workaround 🛠️

No response

Renderer 🎨

  • Skia
  • Native

Affected platforms 📱💻🖥️

No response

Uno.Sdk version (and other relevant versions) 📦

10.0.10

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… for .NET 10 compatibility

Co-authored-by: jeromelaban <[email protected]>
@CLAassistant

CLAassistant commented Nov 18, 2025 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ jeromelaban
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Fix service worker error for blazor.boot.json fix: Update service worker to fetch dotnet.js instead of dotnet.boot.js for .NET 10 Nov 18, 2025
Copilot AI requested a review from jeromelaban November 18, 2025 20:25
@jeromelaban

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jeromelaban

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jeromelaban
jeromelaban marked this pull request as ready for review November 18, 2025 23:56
@github-actions

Copy link
Copy Markdown

@jeromelaban

Copy link
Copy Markdown
Member

@copilot There's an additional issue with uno-config.js, which is part of the offline_files list in the wrong path. It's being fetched in ./uno-config.js where it should be fetched from something similar to $(REMOTE_WEBAPP_PATH)$(REMOTE_BASE_PATH)/uno-config.js.

Copilot AI commented Nov 19, 2025

Copy link
Copy Markdown
Contributor Author

@copilot There's an additional issue with uno-config.js, which is part of the offline_files list in the wrong path. It's being fetched in ./uno-config.js where it should be fetched from something ...

Fixed in commit 1f88e80. Updated the offline_files list to include uno-config.js with the correct path prefix: {PackageAssetsFolder}/uno-config.js instead of just uno-config.js.

@github-actions

Copy link
Copy Markdown

@jeromelaban

Copy link
Copy Markdown
Member

@copilot Let's change all the installed .NET versions in CI scripts to .NET 10.0.100

Copilot AI commented Nov 19, 2025

Copy link
Copy Markdown
Contributor Author

@copilot Let's change all the installed .NET versions in CI scripts to .NET 10.0.100

Updated in commit 3a5c8f6. Changed all .NET versions in CI scripts to 10.0.100:

  • .github/workflows/ci.yml: Updated both setup steps to use 10.0.100
  • build/ci/dotnet-install.yml: Updated parameter and install scripts to use 10.0.100

@github-actions

Copy link
Copy Markdown

@jeromelaban
jeromelaban merged commit 2c1918e into main Nov 19, 2025
@jeromelaban
jeromelaban deleted the copilot/fix-service-worker-error branch November 19, 2025 16:03
@jeromelaban

Copy link
Copy Markdown
Member

/unobot backport release/stable/10.0

jeromelaban added a commit that referenced this pull request Nov 19, 2025
…bp1004

fix: Update service worker to fetch dotnet.js instead of dotnet.boot.js for .NET 10 (backport #1004)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ServiceWorker] Error processing blazor.boot.json: Failed to fetch dotnet.boot.js: 404

4 participants