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

Vite 4.1.0 returns internal server error: ENAMETOOLONG instead of 404 for long paths #11904

Closed
7 tasks done
Artur- opened this issue Feb 2, 2023 · 0 comments · Fixed by #11907
Closed
7 tasks done

Comments

@Artur-
Copy link
Contributor

Artur- commented Feb 2, 2023

Describe the bug

When doing a request for /someverylongpath and Vite cannot find the file, it should return 404. It should not throw the internal problem of not being able to run stat on the long path.

We see logs like

[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker - [vite] Internal server error: ENAMETOOLONG: name too long, stat '/home/runner/work/flow/flow/flow-tests/test-router-custom-context/frontend/push?v-r=push&v-uiId=0&v-pushId=2048a0bb-8bf3-40bc-b809-69c42256b207&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=3.1.2-javascript&X-Atmosphere-Transport=long-polling&X-Atmosphere-TrackMessageSize=true&Content-Type=application%2Fjson%3B charset%3DUTF-8&X-atmo-protocol=true&_=1675338547549'

in our tests when upgrading from 4.0.2 to 4.1.0. In this case it is a request that should not go to Vite at all but Vite is first consulted to see if Vite has something to serve. When a 404 is returned then the request is redirected to the correct place.

Reproduction

Not sure

Steps to reproduce

For some reason it does not reproduce locally on my mac. Related to the os or os settings perhaps. The test failures are seen on GitHub actions

System Info

System:
    OS: macOS 13.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 3.38 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Brave Browser: 107.1.45.123
    Chrome: 109.0.5414.119
    Chrome Canary: 112.0.5574.1
    Firefox: 108.0.1
    Firefox Developer Edition: 105.0
    Safari: 16.2

Used Package Manager

npm

Logs

Click to expand!
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker - [vite] Internal server error: ENAMETOOLONG: name too long, stat '/home/runner/work/flow/flow/flow-tests/test-router-custom-context/frontend/push?v-r=push&v-uiId=0&v-pushId=2048a0bb-8bf3-40bc-b809-69c42256b207&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=3.1.2-javascript&X-Atmosphere-Transport=long-polling&X-Atmosphere-TrackMessageSize=true&Content-Type=application%2Fjson%3B charset%3DUTF-8&X-atmo-protocol=true&_=1675338547549'
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at Object.statSync (node:fs:1596:3)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at tryResolveFile (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:21592:23)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at tryFsResolve (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:21565:16)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at Context.resolveId (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:21401:28)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at Object.resolveId (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:41581:46)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at async ModuleGraph.resolveUrl (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:61105:26)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at async ModuleGraph.getModuleByUrl (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:60962:23)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at async doTransform (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:39370:20)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker - [vite] Internal server error: ENAMETOOLONG: name too long, stat '/home/runner/work/flow/flow/flow-tests/test-router-custom-context/frontend/push?v-r=push&v-uiId=0&v-pushId=366bbb56-22ae-42be-be29-a509886b10e5&X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=3.1.2-javascript&X-Atmosphere-Transport=long-polling&X-Atmosphere-TrackMessageSize=true&Content-Type=application%2Fjson%3B charset%3DUTF-8&X-atmo-protocol=true&_=1675338547650'
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at Object.statSync (node:fs:1596:3)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at tryResolveFile (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:21592:23)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at tryFsResolve (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:21565:16)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at Context.resolveId (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:21401:28)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at Object.resolveId (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:41581:46)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at async ModuleGraph.resolveUrl (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:61105:26)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at async ModuleGraph.getModuleByUrl (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:60962:23)
[dev-server-output] INFO com.vaadin.base.devserver.DevServerOutputTracker -       at async doTransform (file:///home/runner/work/flow/flow/flow-tests/test-router-custom-context/node_modules/.pnpm/vite@4.1.0/node_modules/vite/dist/node/chunks/dep-b6b8dfbf.js:39370:20)

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant