Skip to content

--no-unsafe-line generates root url in precache manifest #3033

Closed
@DorianGrey

Description

@DorianGrey

Version

3.2.1

Reproduction link

https://github.com/DorianGrey/vue-ts-playground

Node and OS info

Node 10.13 / yarn 1.12.3 / any OS

Steps to reproduce

  • Checkout the reproduction repo.
  • yarn for installing dependencies
  • yarn build --no-unsafe-inline

Inspect build/precache-manifest.* afterwards.

What is expected?

The entry for the safari-nomodule-fix.js should contain a relative URL so that it can be cached by the service worker.

What is actually happening?

The precache-manifest for the modern part contains an entry for the safari-nomodule-fix.js with a root url, like:

{
  "revision": "3e20c054c9be1ad3a7dfca6f4cfe8939",
  "url": "//js/safari-nomodule-fix.js"
}

When the service worker tries to use this url, it ends up with something like https://js/safari-nomodule-fix.js, which cannot be used.


Ran into this bug when trying to avoid modification of the CSP header to contain a hash. While this is less problematic for me (since I have full control over this header), it might be a larger issue for others.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions