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

[nuxt] [request error] [unhandled] [500] File URL path must not include encoded / characters #16705

Closed
KosyoK1104 opened this issue Jan 24, 2025 · 15 comments · Fixed by #16789 or #16851
Closed
Assignees
Labels
bug Something isn't working jsc Something related to JavaScriptCore node:url

Comments

@KosyoK1104
Copy link

What version of Bun is running?

1.2.0+b0c5a7655

What platform is your computer?

Darwin 24.1.0 arm64 arm

What steps can reproduce the bug?

After upgrading to Bun 1.2, I tried installing clean Nuxt application using this guide: https://bun.sh/guides/ecosystem/nuxt.

After installing everything, I've ran this command:

bun --bun run dev

And tried opening the application, but I was given Error 500 and also in the logs was written:

[nuxt] [request error] [unhandled] [500] File URL path must not include encoded / characters

I tried running this command:

bun run dev

And it works normally.

What is the expected behavior?

No response

What do you see instead?

No response

Additional information

No response

@KosyoK1104 KosyoK1104 added bug Something isn't working needs triage labels Jan 24, 2025
@seh-GAH-toh
Copy link

Same on Fedora 41, error happens in v1.2.0, work fine in v1.1.45

@ghost
Copy link

ghost commented Jan 25, 2025

Same on Ubuntu 24.04 (x64)

@techitwinner
Copy link

techitwinner commented Jan 26, 2025

Same on Windows 11 24H2 (26100.2894)
Bun version: 1.2.0

@yakir-reznik
Copy link

I'm getting the same issue.
When i run "bun run dev" everything works fine.
When i run "bun --bun run dev" I'm getting an error: "[nuxt] [request error] [unhandled] [500] File URL path must not include encoded / characters".

The api routes seem to work fine "/api/hello.ts", the frontend routes are the ones that cause the error. ("/", "/about", ...)

Bun version: 1.2.0
OS: MacOS Sonoma 14.5 (Intel)

@rukshn
Copy link

rukshn commented Jan 26, 2025

Same issue in Mac Book Air M1, Sequoia 15.1
Bun Version: 1.2.0

@GamerGirlandCo
Copy link

same issue. downgrading nuxt to the latest 3.14.x made the error go away, so it's probably a nuxt problem

@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Jan 27, 2025

@DonIsaac this is a regression from adding the node:url tests in #16404

The following example input is throwing an error, and it is valid input that works in Node:

file:///private/tmp/my-nuxt-app/node_modules/nitropack/dist/presets/firebase/runtime/firebase-gen-%7B%7B%20firebase.gen%20%7D%7D'

@27rogi
Copy link

27rogi commented Jan 27, 2025

Seems like Nuxt 3.15.3 with Nitro 2.10.4 on Bun 1.2.1-canary.48+68ee83067 still has error ERROR [nuxt] [request error] [unhandled] [500] File URL path must not include encoded \ or / characters. Running on Windows 11 24H2.

@ghost
Copy link

ghost commented Jan 27, 2025

Not solved for me on latest canary either 😦

@paperclover paperclover reopened this Jan 28, 2025
@paperclover
Copy link
Member

first obvservation is this file url to path function is being called a ton.
Image

@paperclover paperclover assigned paperclover and unassigned DonIsaac Jan 28, 2025
@isaacR23
Copy link

same issue on plain app:
`- Operating System: Darwin

  • Node Version: v23.1.0
  • Nuxt Version: 3.15.3
  • CLI Version: 3.20.0
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: compatibilityDate, devtools, modules, vite
  • Runtime Modules: @nuxtjs/[email protected]
  • Build Modules: -`
Image

@asphum
Copy link

asphum commented Jan 28, 2025

ssr: false = is work.

@paperclover
Copy link
Member

the bug is in pathToFileURL

@paperclover paperclover added jsc Something related to JavaScriptCore node:url regression labels Jan 28, 2025
@GamerGirlandCo
Copy link

GamerGirlandCo commented Jan 28, 2025

i have a couple patches for vite-node (the package calling fileURLToPath) in the interim.

these patches make sure to url decode any module urls containing "virtual:nuxt:" before passing them to fileURLToPath.

[email protected]
[email protected]

@paperclover
Copy link
Member

thank you for the interim patch. the escaping logic will be fixed in #16851

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jsc Something related to JavaScriptCore node:url
Projects
None yet