René's URL Explorer Experiment


Title: [BUG][PWA] Url error in the "ngsw.json" file with a "baseHref" pointing to a file (eg: "/index.html") · Issue #12853 · angular/angular-cli · GitHub

Open Graph Title: [BUG][PWA] Url error in the "ngsw.json" file with a "baseHref" pointing to a file (eg: "/index.html") · Issue #12853 · angular/angular-cli

X Title: [BUG][PWA] Url error in the "ngsw.json" file with a "baseHref" pointing to a file (eg: "/index.html") · Issue #12853 · angular/angular-cli

Description: Bug Report or Feature Request - [X] bug report -> please search issues before submitting - [ ] feature request From here: angular/angular#26917 Command - [X] build Versions Angular CLI: 7.0.4 Node: 10.8.0 (npm: 6.3.0) OS: win32 x64 Angul...

Open Graph Description: Bug Report or Feature Request - [X] bug report -> please search issues before submitting - [ ] feature request From here: angular/angular#26917 Command - [X] build Versions Angular CLI: 7.0.4 Node:...

X Description: Bug Report or Feature Request - [X] bug report -> please search issues before submitting - [ ] feature request From here: angular/angular#26917 Command - [X] build Versions Angular CLI: 7.0.4 No...

Opengraph URL: https://github.com/angular/angular-cli/issues/12853

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG][PWA] Url error in the \"ngsw.json\" file with a \"baseHref\" pointing to a file (eg: \"/index.html\")","articleBody":"### Bug Report or Feature Request\r\n```\r\n- [X] bug report -\u003e please search issues before submitting\r\n- [ ] feature request\r\n```\r\nFrom here: https://github.com/angular/angular/issues/26917\r\n\r\n### Command\r\n```\r\n- [X] build\r\n```\r\n\r\n### Versions\r\n```\r\nAngular CLI: 7.0.4\r\nNode: 10.8.0 (npm: 6.3.0)\r\nOS: win32 x64\r\nAngular: 7.0.2\r\n... animations, cdk, common, compiler, compiler-cli, core, forms\r\n... http, language-service, material, platform-browser\r\n... platform-browser-dynamic, router, service-worker\r\n\r\nPackage                           Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect         0.10.4\r\n@angular-devkit/build-angular     0.10.4\r\n@angular-devkit/build-optimizer   0.10.4\r\n@angular-devkit/build-webpack     0.10.4\r\n@angular-devkit/core              7.0.4\r\n@angular-devkit/schematics        7.0.4\r\n@angular/cli                      7.0.4\r\n@angular/pwa                      0.10.4\r\n@ngtools/webpack                  7.0.4\r\n@schematics/angular               7.0.4\r\n@schematics/update                0.10.4\r\nrxjs                              6.3.3\r\ntypescript                        3.1.6\r\nwebpack                           4.19.1\r\n```\r\n\r\n\r\n## Current behavior\r\nI have a problem with the file `ngsw.json` (`dist/xxx/ngsw.json`), when I build my application.\r\nHere is the configuration of my file `angular.json`:\r\n```json\r\n{\r\n  \"$schema\": \"./node_modules/@angular/cli/lib/config/schema.json\",\r\n  \"version\": 1,\r\n  \"newProjectRoot\": \"projects\",\r\n  \"projects\": {\r\n    \"xxxxxx-xxxxxx-web\": {\r\n      ...\r\n      \"architect\": {\r\n        \"build\": {\r\n          \"builder\": \"@angular-devkit/build-angular:browser\",\r\n          \"options\": {\r\n            \"baseHref\": \"/index.html\",   \u003c-- baseHref with path to a file\r\n            ...\r\n          },\r\n          \"configurations\": {\r\n            \"develop\": {\r\n              ...\r\n              \"baseHref\": \"/dev-web-xxxxxx-xxxxxx/index.html\",   \u003c-- baseHref with path to a file\r\n              \"fileReplacements\": [\r\n                {\r\n                  \"replace\": \"src/environments/environment.ts\",\r\n                  \"with\": \"src/environments/environment.develop.ts\"\r\n                }\r\n              ],\r\n              \"optimization\": true,\r\n              \"outputHashing\": \"all\",\r\n              \"sourceMap\": true,\r\n              \"extractCss\": true,\r\n              \"namedChunks\": false,\r\n              \"aot\": true,\r\n              \"extractLicenses\": true,\r\n              \"vendorChunk\": false,\r\n              \"buildOptimizer\": true,\r\n              \"serviceWorker\": true\r\n            }\r\n            ...\r\n```\r\nAs you can see, my `baseHref` points to a file (`index.html`). And when I compile, here is the result of the file `ngsw.json`:\r\n```json\r\n{\r\n  \"configVersion\": 1,\r\n  \"index\": \"/dev-web-xxxxxx-xxxxxx/index.html/index.html\",\r\n  \"assetGroups\": [                 ^^^^^^^^^^\r\n    {\r\n      \"name\": \"app\",\r\n      \"installMode\": \"prefetch\",\r\n      \"updateMode\": \"prefetch\",\r\n      \"urls\": [                 vvvvvvvvvv\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/4.459d2c031076fa54578c.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/5.b0a92526f07730e41004.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/index.html\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/main.284d15247a9766d625e1.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/polyfills.f8bea440aac573c30541.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/runtime.e04cbf91ceee4f9b3494.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/styles.380a38f67b77a997829f.css\"\r\n      ],                        ^^^^^^^^^^\r\n      \"patterns\": []\r\n    },\r\n    {\r\n      \"name\": \"assets\",\r\n      \"installMode\": \"lazy\",\r\n      \"updateMode\": \"prefetch\",\r\n      \"urls\": [                 vvvvvvvvvv\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/assets/icons/icon-128x128.png\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html/assets/icons/icon-144x144.png\",\r\n        ...                     ^^^^^^^^^^\r\n```\r\nAs you can see, it generates all the urls of the file with the `.../index.html/...`, as if it were a folder. As this file is used for the cache of the application, the cache does not work since it is not the right url...\r\n\r\n\r\n## Expected behavior\r\n\u003c!-- Describe what the desired behavior would be. --\u003e\r\nI think the file should have looked like this:\r\n```json\r\n{\r\n  \"configVersion\": 1,\r\n  \"index\": \"/dev-web-xxxxxx-xxxxxx/index.html\",\r\n  \"assetGroups\": [\r\n    {\r\n      \"name\": \"app\",\r\n      \"installMode\": \"prefetch\",\r\n      \"updateMode\": \"prefetch\",\r\n      \"urls\": [\r\n        \"/dev-web-xxxxxx-xxxxxx/4.459d2c031076fa54578c.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/5.b0a92526f07730e41004.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/index.html\",\r\n        \"/dev-web-xxxxxx-xxxxxx/main.284d15247a9766d625e1.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/polyfills.f8bea440aac573c30541.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/runtime.e04cbf91ceee4f9b3494.js\",\r\n        \"/dev-web-xxxxxx-xxxxxx/styles.380a38f67b77a997829f.css\"\r\n      ],\r\n      \"patterns\": []\r\n    },\r\n    {\r\n      \"name\": \"assets\",\r\n      \"installMode\": \"lazy\",\r\n      \"updateMode\": \"prefetch\",\r\n      \"urls\": [\r\n        \"/dev-web-xxxxxx-xxxxxx/assets/icons/icon-128x128.png\",\r\n        \"/dev-web-xxxxxx-xxxxxx/assets/icons/icon-144x144.png\",\r\n        ...\r\n```\r\n\r\n\r\n## Minimal reproduction of the problem with instructions\r\n\u003c!--\r\nFor bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via\r\nhttps://stackblitz.com or similar (you can use this template as a starting point: https://stackblitz.com/fork/angular-gitter).\r\n--\u003e\r\nYou just have to create an application (which uses PWA) and have a baseHref that points to a file (eg: `index.html`). And when you compile your application, the url generated in the `ngsw.json` file will be wrong.\r\n\r\n## What is the motivation / use case for changing the behavior?\r\n\u003c!-- Describe the motivation or the concrete use case. --\u003e\r\nI think it would just take into account when the \"baseHref\" to deal with a file, take the root of the file (and not take the file for a folder).\r\n\r\nFor information, I use a `baseHref` to a file, because I use the system of route of Angular with the hash and that the url `https://storage.googleapis.com/dev-web-xxxxxx-xxxxxx/` does not point towards my file `index.html`. As the project is hosted on a Google Cloud Storage, when we update the application (CTRL+F5, ...) with a url of this type `...-xxxxxx/#/user/login`, I end up with a 404 error (because the url in `...-xxxxxx/` does not point to the file `index.html`). To solve this problem, I force Angular to keep the `index.html` in the URL (eg: `...-xxxxxx/index.html#/user/login`), through `baseHref` with the `index.html` in it.\r\n\r\nFor now, I make the corrections of the url in the file `ngsw.json` manually, so that the cache of the application works...\r\n","author":{"url":"https://github.com/sitexw","@type":"Person","name":"sitexw"},"datePublished":"2018-11-02T11:33:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/12853/angular-cli/issues/12853"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8cec1ea4-fac0-3d5a-8e24-37992eaa58fb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCB1E:3D21D:1B433D6:2570E54:6964C006
html-safe-nonce25f735ccdf7febe64594526c99cd324dc37ec1e7fa12f1057b6d6aa8e24891b2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQjFFOjNEMjFEOjFCNDMzRDY6MjU3MEU1NDo2OTY0QzAwNiIsInZpc2l0b3JfaWQiOiI3NDYzNDM5NjU3ODYxNDMxMzAyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb0bcafde1f90906c966eccb00128b8cc0b4adb2d76fa5b3e6b567fb3f2a8be56
hovercard-subject-tagissue:376774436
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/12853/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a5ae9b4f87af0aacb5506a4429a2502752ae60d4525f608f1a47cbc290724f7d/angular/angular-cli/issues/12853
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a5ae9b4f87af0aacb5506a4429a2502752ae60d4525f608f1a47cbc290724f7d/angular/angular-cli/issues/12853
og:image:altBug Report or Feature Request - [X] bug report -> please search issues before submitting - [ ] feature request From here: angular/angular#26917 Command - [X] build Versions Angular CLI: 7.0.4 Node:...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesitexw
hostnamegithub.com
expected-hostnamegithub.com
None21df671ce2c9f1a16940ccbd3af6cb4f3f12a856929ca7eb1b4aea8e384ea442
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5707c685ac172d50a0bdd7533dde4f8aabcf8eef
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/12853#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F12853
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F12853
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/12853
Reloadhttps://github.com/angular/angular-cli/issues/12853
Reloadhttps://github.com/angular/angular-cli/issues/12853
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 264 https://github.com/angular/angular-cli/issues
Pull requests 24 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/angular/angular-cli/security
Please reload this pagehttps://github.com/angular/angular-cli/issues/12853
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/12853
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/12853
Bughttps://github.com/angular/angular-cli/issues?q=type:"Bug"
[BUG][PWA] Url error in the "ngsw.json" file with a "baseHref" pointing to a file (eg: "/index.html")https://github.com/angular/angular-cli/issues/12853#top
area: @angular-devkit/build-angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular-devkit%2Fbuild-angular%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular-cli/milestone/12
https://github.com/sitexw
https://github.com/sitexw
sitexwhttps://github.com/sitexw
on Nov 2, 2018https://github.com/angular/angular-cli/issues/12853#issue-376774436
angular/angular#26917https://github.com/angular/angular/issues/26917
area: @angular-devkit/build-angularhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular-devkit%2Fbuild-angular%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Bughttps://github.com/angular/angular-cli/issues?q=type:"Bug"
BacklogNo due datehttps://github.com/angular/angular-cli/milestone/12
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.