-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Description
Describe the bug
After starting a dev server with vite, heading to a URL like http://localhost:3000/a%a will crash the server.
#5860 is similar but didn't have reproduction.
Reproduction
Can be reproduced with the default vanilla Vite starter
System Info
Binaries:
Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
Browsers:
Firefox: 95.0.1
npmPackages:
vite: ^2.7.2 => 2.7.9Used Package Manager
pnpm
Logs
> pnpm run dev -- --clearScreen=false --debug
> vite-project@0.0.0 dev /home/bauke/p/testing/vite-project
> vite "--clearScreen=false" "--debug"
vite:config no config file found. +0ms
vite:config using resolved config: {
vite:config root: '/home/bauke/p/testing/vite-project',
vite:config base: '/',
vite:config mode: 'development',
vite:config configFile: undefined,
vite:config logLevel: undefined,
vite:config clearScreen: false,
vite:config server: { fs: { strict: true, allow: [Array], deny: [Array] } },
vite:config configFileDependencies: [],
vite:config inlineConfig: {
vite:config root: undefined,
vite:config base: undefined,
vite:config mode: undefined,
vite:config configFile: undefined,
vite:config logLevel: undefined,
vite:config clearScreen: false,
vite:config server: { fs: [Object] }
vite:config },
vite:config resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
vite:config publicDir: '/home/bauke/p/testing/vite-project/public',
vite:config cacheDir: '/home/bauke/p/testing/vite-project/node_modules/.vite',
vite:config command: 'serve',
vite:config isProduction: false,
vite:config plugins: [
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:modulepreload-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html-inline-script-proxy',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'vite:define',
vite:config 'vite:css-post',
vite:config 'vite:client-inject',
vite:config 'vite:import-analysis'
vite:config ],
vite:config build: {
vite:config target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
vite:config polyfillModulePreload: true,
vite:config outDir: '/home/bauke/p/testing/vite-project/dist',
vite:config assetsDir: 'assets',
vite:config assetsInlineLimit: 4096,
vite:config cssCodeSplit: true,
vite:config cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
vite:config sourcemap: false,
vite:config rollupOptions: {},
vite:config minify: 'esbuild',
vite:config terserOptions: {},
vite:config write: true,
vite:config emptyOutDir: null,
vite:config manifest: false,
vite:config lib: false,
vite:config ssr: false,
vite:config ssrManifest: false,
vite:config reportCompressedSize: true,
vite:config chunkSizeWarningLimit: 500,
vite:config watch: null,
vite:config commonjsOptions: { include: [Array], extensions: [Array] },
vite:config dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
vite:config },
vite:config preview: {
vite:config port: undefined,
vite:config strictPort: undefined,
vite:config host: undefined,
vite:config https: undefined,
vite:config open: undefined,
vite:config proxy: undefined,
vite:config cors: undefined
vite:config },
vite:config env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
vite:config assetsInclude: [Function: assetsInclude],
vite:config logger: {
vite:config hasWarned: false,
vite:config info: [Function: info],
vite:config warn: [Function: warn],
vite:config warnOnce: [Function: warnOnce],
vite:config error: [Function: error],
vite:config clearScreen: [Function: clearScreen],
vite:config hasErrorLogged: [Function: hasErrorLogged]
vite:config },
vite:config packageCache: Map(0) {},
vite:config createResolver: [Function: createResolver],
vite:config optimizeDeps: {
vite:config esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
vite:config }
vite:config } +4ms
vite:deps Hash is consistent. Skipping. Use --force to override. +0ms
vite v2.7.9 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 119ms.
/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:52138
let url = decodeURI(removeTimestampQuery(req.url)).replace(NULL_BYTE_PLACEHOLDER, '\0');
^
URIError: URI malformed
at decodeURI (<anonymous>)
at viteTransformMiddleware (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:52138:19)
at call (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:40249:7)
at next (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:40193:5)
at /home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:51783:28
at viteServePublicMiddleware (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:51822:9)
at call (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:40249:7)
at next (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:40193:5)
at next (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:40171:14)
at next (/home/bauke/p/testing/vite-project/node_modules/.pnpm/vite@2.7.9/node_modules/vite/dist/node/chunks/dep-4b9dfa16.js:40171:14)
ELIFECYCLE Command failed with exit code 1.Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- 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 https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable