sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

Export preload links with crossorigin="use-credentials" stops preloads being used in Chrome #1700

Open madeleineostoja opened 3 years ago

madeleineostoja commented 3 years ago

Describe the bug <link rel="preload" ... /> hints that are used in exported Sapper apps for scripts with the crossorigin attribute set to use-credentials stop the script being used in Chrome. Making the preloads useless, and heavily impacting performance.

Logs

Screen Shot 2021-01-21 at 4 27 44 PM Screen Shot 2021-01-21 at 4 23 06 PM

Information about your Sapper Installation:

System:
    OS: macOS 11.0.1
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Memory: 2.84 GB / 16.00 GB
    Shell: 5.7.1 - /usr/local/bin/zsh
  Binaries:
    Node: 12.6.0 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 87.0.4280.141
    Firefox: 74.0
    Safari: 14.0.1

Severity Not breaking any functionality, but does have bad performance implications, especially in Lighthouse where TTI is crucial.

johannchopin commented 3 years ago

I have the same issue #1727 but in my case the scripts are not loaded so the app is not useable (ex: the routing doesn't work at all and give the error Cannot read property 'parentNode' of undefined if I click on a link)