Comments (4)
Changing to url('~/public/favicon.ico') does the trick.
No it doesn't really do the trick. Because this results in the static file being copied as an asset.
Which means that:
- it doesn't benefit from proper browser caching afterwards, because of the name hashing
- gets needlessly preloaded as if it was a critical part of the application (it's a referenced asset, technically, after all)
We're having this issue with our font faces, ie this (if we add the ~/public
prefix to "fix" the warning):
@font-face {
font-display: swap;
font-family: "Poppins";
font-style: normal;
font-weight: 100;
src:
url("/fonts/poppins/poppins-v19-100.woff2") format("woff2"),
url("/fonts/poppins/poppins-v19-100.woff") format("woff");
}
@font-face {
font-display: swap;
font-family: "Poppins";
font-style: normal;
font-weight: 300;
src:
url("/fonts/poppins/poppins-v19-300.woff2") format("woff2"),
url("/fonts/poppins/poppins-v19-300.woff") format("woff");
}
[...]
This will then end up inside the manifest and all other places where we then have to specifically remove it from. And we still lose caching.
from nuxt.
Start a new pull request in StackBlitz Codeflow.
from nuxt.
Changing to url('~/public/favicon.ico')
does the trick.
And shouldn't it be this way to refer to local assets/public file?
from nuxt.
I'm also seeing those warnings on all my Nuxt projects where I'm referencing files in my styles.
3.11.0's release notes did mention a "reimplementation of Vite's public asset handling" with #26163
[...] this PR takes full control over public assets and bypasses the vite pipeline entirely for them.
With vite.publicDir.$resolve(val)
now only returning false
.
from nuxt.
Related Issues (20)
- When I set ssr to false, configured dynamic route [...slug].vue , click into the sub-page is normal, when I refresh in the sub-page appears in the picture, the link in the parameter for /classify/1/1 , classify for the route, /1/1 for the parameter, at this time to refresh on this error HOT 2
- Hello World example from doc not working HOT 1
- Server components cause hydration error when used inside resolved component HOT 1
- context.outputFileSystem.lstat is not a function HOT 8
- Nuxt > 3.8.1 <client-only> showing blank with "builder: webpack" HOT 4
- "joinRelativeURL" is not exported by "../../node_modules/ufo/dist/index.mjs", imported by "virtual:nuxt:C:/Users/MyPc/Workspace/my-project/apps/my-app/.nuxt/paths.mjs". HOT 2
- set `{ deep: false }` by default for data fetching composables HOT 1
- Improved Directory Structure HOT 66
- Minimize NuxtLink Size
- [Bug] [`@vue/compiler-sfc`] Read files based on Nuxt project/VFS in a monorepo HOT 1
- Add ability to prerender pages without including them in routes HOT 1
- After the first page jumps to the second page, click the back button again, the keep-alive of the first page does not take effect, and return to the first page still requests data again. HOT 1
- nuxt-client attribute doesn't hydrate a component inside a server component HOT 3
- Browser console warning when debugging HOT 1
- CSS HMR errors from Tailwind arbitrary value classes HOT 3
- 3.11.1 Pinia not working HOT 2
- Template installation error HOT 2
- Vue Dev Tools (Browser Extension) in Browser Inspector disappear when Nuxt Devtools are enabled HOT 5
- Cannot restart nuxt: Cannot read properties of undefined (reading 'toast') HOT 3
- onMounted fires before the properties have time to accept the ref in the client. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuxt.