You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Launch https server with vite preview command (not working with vite preview --https)
Alternative solution:
WARNING: this solution introduces security vulnerability in your code. This should not be used in production. @vitejs/plugin-basic-ssl and vite-plugin-mkcert plugins can be used when CSRF protection is disabled.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
You can find bug reproduction and solution in this repo
Bug report
with
vite preview
, form action requests are blocked with messageCross-site POST form submissions are forbidden
.requests are blocked when using:
@vitejs/plugin-basic-ssl
pluginvite-plugin-mkcert
pluginSee bug in plugin-basic-ssl branch
Solution:
form action requests are accepted when using your own certificate in TLS only mode.
mkdir cert cd cert mkcert -key-file key.pem -cert-file cert.pem localhost
vite.config.ts
vite.config.ts
(not working with tls+http2):vite preview
command (not working withvite preview --https
)Alternative solution:
WARNING: this solution introduces security vulnerability in your code. This should not be used in production.
@vitejs/plugin-basic-ssl
andvite-plugin-mkcert
plugins can be used when CSRF protection is disabled.svelte.config.js
:From there:
vite preview --https
doesn't workBeta Was this translation helpful? Give feedback.
All reactions