vite
vite copied to clipboard
The typescripe project compiled by vite cannot run normally on safari, but it can run normally on chrome
Describe the bug
https://github.com/tauri-apps/create-tauri-app/issues/87
Then I start the project through the command about
npm run tauri dev
, but it gives an error when rendering。
Below is info of
npm run tauri info
:
Below is struct of the project:
![image](https://user-images.githubusercontent.com/16849315/180980565-8db707f5-6d63-409c-93c9-98a09bc8f72e.png)
Reproduction
npm create vite@latest
System Info
Below is info of `npm run tauri info`:
<img width="380" alt="image" src="https://user-images.githubusercontent.com/16849315/180134132-f8c1d14c-bc8d-4436-8fe6-110462c993b0.png">
<img width="247" alt="image" src="https://user-images.githubusercontent.com/16849315/180134285-250df6f7-66bf-4427-8aa3-6ca777415fe9.png">
it is ok in chrome:
<img width="1211" alt="image" src="https://user-images.githubusercontent.com/16849315/181007749-16f1993f-5ce3-4df2-bab6-18732538da02.png">
it is not ok in safari,the safari‘s version is 13.0.3 (13608.3.10.10.1)
<img width="1224" alt="image" src="https://user-images.githubusercontent.com/16849315/181008275-f96fd4ef-4191-4874-868f-84def821a4f7.png">
Used Package Manager
npm
Logs
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [X] The provided reproduction is a minimal reproducible example of the bug.
What Vite version are you using? This should be fixed in latest wit https://github.com/vitejs/vite/pull/9315. Otherwise your code may be using ?.
optional chaining which Vite doesn't transpile by default if it's in JS.
vite/3.0.2 darwin-x64 node-v16.16.0
vite/3.0.2 darwin-x64 node-v16.16.0
Can you try Vite 3.0.3 or 3.0.4?
Vite 3.0.3
@zw201913 globalThis
is supported by Safari 13.0.3. So that error shouldn't be happening.
Would you paste the result of npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers
?
![image](https://user-images.githubusercontent.com/16849315/182033878-ccd48793-e9cb-4fd8-9918-518e69ad6f65.png)
Ummm, I think this is a bug in Safari or tauri. Or tauri is using Safari other than 13.0.3.
Does opening localhost:5173 by Safari work?
Yes! success in Safari
![image](https://user-images.githubusercontent.com/16849315/182034699-d8d2a122-dfac-497c-bac1-951a585dcca6.png)
Then, I think tauri is using a different version of Safari.
Closing as this is not a bug in Vite. (Vite doesn't support old browsers during dev)