-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
url()
references in css files do not use assetPrefix
in transformed urls
#24952
Comments
Seems to be related to this although the reproduction example I provided still sees faulty media paths |
@genetschneider Are you able to resolve this? |
I found a related error and experienced this bug as well. |
+1 |
1 similar comment
This comment has been minimized.
This comment has been minimized.
Also broken for output: export seeing path on url is |
Gave up and moved to straight react and vite |
I'll take that as a last resort. |
According to Doc of assetPrefix, The It is a pain point for deploy Next.js APP to Is there any workaround that we can add prefix path to files from Usage Examples: .css {
url('/vercel.svg')
}
<img src="'/vercel.svg'" alt=""> |
What version of Next.js are you using?
10.2.0
What version of Node.js are you using?
14.16.0
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
npm run dev (with custom express server)
Describe the Bug
Custom
assetPrefix
does not prefix reference urls that have been automatically transformed in css files. If a css file references a font for example, the transformed url font will not useassetPrefix
even though a proper value forassetPrefix
has been setThe url transformation seems to be happening here here
Expected Behavior
Transformed urls in css will use
assetPrefix
similar to other static assets whenassetPrefix
is defined.Font should be loaded as (
assetPrefix
exists in url)http://localhost:3000/prefix-a/_next/static/media/Itim-Regular.f70e0d25637f63995673d4cb6429d3ab.ttf
But it's actually loaded as (no
assetPrefix
in url)http://localhost:3000/_next/static/media/Itim-Regular.f70e0d25637f63995673d4cb6429d3ab.ttf
To Reproduce
Repository with full reproduction can be found here. Just
npm run build
andnpm run dev
and you'll notice the issue immediately.The text was updated successfully, but these errors were encountered: