Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The typescripe project compiled by vite cannot run normally on safari, but it can run normally on chrome #9416

Closed
7 tasks done
zw201913 opened this issue Jul 28, 2022 · 11 comments

Comments

@zw201913
Copy link

zw201913 commented Jul 28, 2022

Describe the bug

tauri-apps/create-tauri-app#87
image
Then I start the project through the command about npm run tauri dev, but it gives an error when rendering。
image
Below is info of npm run tauri info:
image
image
Below is struct of the project:
image

image

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

@bluwy
Copy link
Member

bluwy commented Jul 29, 2022

What Vite version are you using? This should be fixed in latest wit #9315. Otherwise your code may be using ?. optional chaining which Vite doesn't transpile by default if it's in JS.

@zw201913
Copy link
Author

vite/3.0.2 darwin-x64 node-v16.16.0

1 similar comment
@zw201913
Copy link
Author

vite/3.0.2 darwin-x64 node-v16.16.0

@bluwy
Copy link
Member

bluwy commented Jul 29, 2022

Can you try Vite 3.0.3 or 3.0.4?

@zw201913
Copy link
Author

Vite 3.0.3
image

@sapphi-red
Copy link
Member

@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?

@zw201913
Copy link
Author

image

@sapphi-red
Copy link
Member

Ummm, I think this is a bug in Safari or tauri.
Or tauri is using Safari other than 13.0.3.

@sapphi-red
Copy link
Member

Does opening localhost:5173 by Safari work?

@zw201913
Copy link
Author

Yes! success in Safari
image

image

@sapphi-red
Copy link
Member

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)

@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants