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

Error during nuxi generate in link[href] with data url containing slashes #1431

Closed
issue-up bot opened this issue Jul 14, 2023 · 3 comments
Closed

Error during nuxi generate in link[href] with data url containing slashes #1431

issue-up bot opened this issue Jul 14, 2023 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers nuxt upstream

Comments

@issue-up
Copy link

issue-up bot commented Jul 14, 2023

   Forwarded from downstream issue:


Environment


  • Operating System: Linux
  • Node Version: v16.20.0
  • Nuxt Version: 3.6.2
  • Nitro Version: 2.5.2
  • Package Manager: npm@9.4.2
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-nj2nvg?file=pages%2Findex.vue

Describe the bug

Running nuxi generate raises an error when a project contains a HTML snippet like below.

<link rel="icon" href="data:image/png;base64,aaa//bbbbbb/ccc">

In this reproduction, nitro recognize /ccc as a linked page path by mistake. Route /ccc doesn't exist so it causes error in nuxi generate.

(workaround: setting nitro.prerender.failOnError config to false to simply ignore 404 error in prerendering)

Additional context

No response

Logs

No response

@fabiankachlock
Copy link

fabiankachlock commented Jul 27, 2023

This seems to be an upstream issue at ufo. Their parseURL function is used to parse links when pre-rendering, which is returning /ccc as the pathname for the data url.
I don't know how parseURL should behave when a data url is provided as an argument, so it might just be done by filtering data url's when extracting links on pre-render.

@fabiankachlock
Copy link

Thanks to @pi0 for the quick fix!
As so soon as this fix is released we can bump the dependency and this issue should be resolved.

@fabon-f
Copy link

fabon-f commented Aug 27, 2023

I think this issue also can be closed because the upstream (unjs/ufo) fix is already released.

@pi0 pi0 reopened this Aug 27, 2023
@pi0 pi0 closed this as completed in 6793b40 Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers nuxt upstream
Projects
None yet
Development

No branches or pull requests

5 participants