Closed shirakaba closed 3 years ago
Though I can't reproduce this issue under macOS Big Sur, after looking into the generated code, I find that it is a bug caused by the ignoreDepPlugin
in the build config.
The dependencies are not ignored, but shimmed with an empty object, which confuses the ws
package.
I'll open a PR tomorrow.
Describe the bug
In macOS Safari, when switching route (i.e. by clicking a link such
<a sveltekit:prefetch="" href="/nouns-1-mora" class="s-Xvih31qJPb_c">1-mora nouns</a>
, or by updating the URL bar manually), the errorTypeError: bu.unmask is not a function
appears, killing the dev server. The full error log is provided at the bottom of the issue.As well as macOS Safari, the issue also appears to occur on iOS Safari, as seen by this duplicate issue that was closed due to lack of information: https://github.com/vitejs/vite/issues/3850. Of great note, it does not occur on macOS Firefox nor macOS Chrome on my system, so it seems to be a Safari-specific issue regarding missing functionality. Perhaps this
unmask
function does not exist on the buffer instance in Safari.Curiously, however, whichever route is first loaded from the dev server will succeed; it's just that subsequent changes in route will not. So, just after starting the dev server, I could navigate to http://localhost:3000/nouns-1-mora just fine – but clicking links to navigate to another page like
/
would fail.Reproduction
The repo https://github.com/shirakaba/jp-pitch-accent exhibits the issue. It was created using the SvelteKit CLI command
npm init svelte@next jp-pitch-accent
, and the changes relative to the starter template are minimal. To reproduce the issue, first clone the repo and get the Vite server running:Setting up the repro
Reproducing the error
Now visit http://localhost:3000 in macOS Safari. Click one of the links along the header (excluding the Twitter and GitHub links, which aren't locally served sites), such as "2-mora nouns" and you should see a view like below:
Note how, following the navigation action, the console now shows messages indicating failure to connect to the Vite server, and the GitHub and Twitter icons have become missing images. If you now view your Vite server, you will see that it has thrown an error and has exited prematurely.
System Info
Note that I am using the macOS Monterey beta. I can't recall whether or not I was experiencing the issue back on Catalina.
Used package manager: npm
Logs
I apologise that I don't quite know how svelte-kit drives
vite
so I can't turn on the--debug
flag, but here are the debug logs I have access to:Before submitting the issue, please make sure you do the following