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

The html generated by Nuxt 3 is not valid: prefetch cannot be used as a script or style in the link element. #721

Closed
timoanttila opened this issue Mar 16, 2023 · 0 comments

Comments

@timoanttila
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v16.16.0
  • Nuxt Version: 3.3.1
  • Nitro Version: 2.3.1
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: target, modules, css, unocss, routeRules
  • Runtime Modules: @nuxt/content@2.3.0, @unocss/nuxt@0.48.4
  • Build Modules: -

Reproduction

https://github.com/timoanttila/timoanttila

Describe the bug

A link element with an as attribute must have a rel attribute that contains the value preload or the value modulepreload.

The same problem exists in two different projects. Most components / javascripts are preload + module or modulepreload, but for example these three files are loaded differently and this is not correct way to do that.

The same issue exists in two separate projects. Most components / javascripts are preload + module or modulepreload, but these three files are loaded differently, which is incorrect. Perhaps all of the custom components are loaded incorrectly?

My personal website has only these three:

<link rel="prefetch" as="script" crossorigin href="/_nuxt/web-socket.215ff2e0.js">
<link rel="prefetch" as="script" crossorigin href="/_nuxt/asyncData.f44093df.js">
<link rel="prefetch" as="script" crossorigin href="/_nuxt/error-component.542c25fa.js">

Another project has 13 incorrectly loaded files.

<link rel="prefetch" as="script" crossorigin href="/_nuxt/Price.cda37566.js">
<link rel="prefetch" as="script" crossorigin href="/_nuxt/ProductCart.c9696fae.js">

Additional context

No response

Logs

No response

@timoanttila timoanttila closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2023
@danielroe danielroe mentioned this issue Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant