-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
react-router@7 & vite@5 + SSL doesn't work #12558
Comments
Is it related and worth noting that |
What happens if you set your own I'm using Remix+Vite with SSL myself (with some certs from mkcert) and don't have this issue. If it's helpful, this is my config: import { resolve } from 'path'
import { existsSync, readFileSync } from 'fs'
import { vitePlugin as remix } from '@remix-run/dev'
import { defineConfig } from 'vite'
import tsconfigPaths from 'vite-tsconfig-paths'
const crtPath = resolve(__dirname, 'tls.crt')
const keyPath = resolve(__dirname, 'tls.key')
const httpsOptions = existsSync(crtPath)
? {
cert: readFileSync(crtPath),
key: readFileSync(keyPath)
}
: {}
export default defineConfig({
server: {
port: 1234,
host: 'localhost',
https: httpsOptions
},
plugins: [
remix({
future: {
v3_routeConfig: true,
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
v3_singleFetch: true,
v3_lazyRouteDiscovery: true
}
}),
tsconfigPaths()
]
}) |
@timdorr
Error occurs by adding config to
Just for clarification - this happens ONLY if you try to use react-router. If you init project with https://remix.run/docs/en/main/start/quickstart (just like you seem to have) there is no error and https works |
Thank you @timdorr. I'm having the same problems after following your suggestion and configuring |
FWIW the |
Same issue here when setting the |
Reproduction
I simply followed the instructions at https://reactrouter.com/start/framework/installation
npx create-react-router@latest my-react-router-app cd my-react-router-app npm i npm run dev
and http://localhost:5173 just works.
Installing and adding
@vitejs/plugin-basic-ssl
tovite.config.js
likeresults in a server error when trying to open https://localhost:5173/:
I checked if the error occurs without React Router by following the instructions at https://vite.dev/guide/#scaffolding-your-first-vite-project
and installing and adding
@vitejs/plugin-basic-ssl
tovite.config.js
like. Result: https://localhost:5173/ does work.
The error does not occur after adding
server.proxy = {}
tovite.config.js
:According to vitejs/vite#4184 this leads to the usage of
HTTP/1.1
.Probably related:
System Info
Used Package Manager
npm
Expected Behavior
Dev server running on HTTPS should work.
Actual Behavior
Dev server running on HTTPS doesn't work.
The text was updated successfully, but these errors were encountered: