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

URL Query Parameter with %0A causes vite to fail #3761

Closed
6 tasks done
stefnotch opened this issue Jun 11, 2021 · 0 comments · Fixed by #3780
Closed
6 tasks done

URL Query Parameter with %0A causes vite to fail #3761

stefnotch opened this issue Jun 11, 2021 · 0 comments · Fixed by #3780
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@stefnotch
Copy link
Contributor

Describe the bug

When navigating to a URL with a query parameter that contains a %0A, the vite development server will fail

Reproduction

Start a local vite project and navigate to the following URL. I've been able to reproduce this with two separate projects running the latest version of vite.
http://localhost:3000/?cat=%0A

Repository
https://github.com/stefnotch/starboard-editor

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz 
    Memory: 22.48 GB / 31.86 GB
  Binaries:
    Node: 16.0.0 - C:\Program Files\nodejs\node.EXE        
    npm: 7.11.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (91.0.864.41)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    @vitejs/plugin-vue: ^1.2.3 => 1.2.3
    vite: ^2.3.7 => 2.3.7

Used package manager:

Logs

3:10:34 pm [vite] Internal server error: Failed to resolve entry for package "C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\". The package may have incorrect main/module/exports specified in its package.json.
      at resolvePackageEntry (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:32615:15)
      at tryResolveFile (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:32398:24)
      at tryFsResolve (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:32375:16)
      at Context.resolveId (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:32250:28)
      at Object.resolveId (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:44708:55)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async ModuleGraph.resolveUrl (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:59608:36)
      at async ModuleGraph.getModuleByUrl (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:59495:23)
      at async transformRequest (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:58955:20)
      at async viteTransformMiddleware (C:\Users\Stefnotch\Documents\GitHub\Tools\starboard-editor\node_modules\vite\dist\node\chunks\dep-bc228bbb.js:59167:32)

Before submitting the issue, please make sure you do the following

  • 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.
  • Provide a description in this issue that describes the bug.
  • 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.
Sociosarbis added a commit to Sociosarbis/vite that referenced this issue Jun 12, 2021
@patak-dev patak-dev added bug p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Jul 7, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants