-
Notifications
You must be signed in to change notification settings - Fork 88
[Help wanted]: Some of public folder assets is not accessable when deploying NextJS app with basePath #1849
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
Comments
I'm hitting this issue too, been looking around for a fix today. It looks like this GH issue and the WIP PR are both very fresh. What's a normal cadence for getting a fix like this into prod? Hours? Days? In the meantime is there something I can do to fix/workaround? |
@Flaysh I'm not sure if this works in your setup, but I was able to temp workaround this by using Netlify redirects/proxy in the parent site. Since both my parent site and my subpath site (the one using Next.js
|
Hi. We're not releasing anything until the New Year right now, but I can put out a tagged release later if you want to manually install the runtime. The workaround with redirects looks solid though. |
It's a bit messy to list them all, but you can proxy individual files too:
It's not ideal, but it's temp until this fix is released. @ascorbic what's involved with manually installing the runtime? Just install a version locally in my project and the Netlify deployment engine will use my local version? I'm interested to try it, but proxy workaround is working well enough for now. |
@bkbooth you need to npm/yarn/pnpm install |
Awesome, just tested this on my staging site and the fix & tagged release are working perfectly 🙌 (not using any proxied requests on the staging deploy). I'll apply this to my production release too now. Thanks so much for the quick fix and for doing the tagged release! Merry Christmas (if you celebrate) and Happy New Year! |
I tried it right now and didn't seem to work in my case... Will try to install if I understand right, when the main version is out (in a week or two) I can remove it from my dependencies? |
Uh oh!
There was an error while loading. Please reload this page.
Hey, I have a NextJS built with TypeScript and deployed on Netlify with @netlify/plugin-nextjs
I’m using /m basePath on this web application, and everything works great, except some files under the public folder are not accessible like manifest or favicon files.
Also, its important to say I made this app PWA with next-pwa
Of course, locally everything works great.
For example, I will show the problem with the manifest file:

But, the manifest/favicon is accessible on the root route (‘/’)…
I need them to be accessible on /m like the rest of my public assets.
Things I tried:
Thanks to everyone that will help!
Steps to reproduce
See my deploy preview and see that there is no favicon
A link to a reproduction repository
No response
Next Runtime version
v4.29.3 / latest
More information about your build
netlify.toml
)What OS are you using?
Mac OS
Your netlify.toml file
`netlify.toml`
Your public/_redirects file
`_redirects`
# Paste content of your `_redirects` file here
Your
next.config.js
filenext.config.js file
Builds logs (or link to your logs)
Build logs
Function logs
No response
.next JSON files
No response
The text was updated successfully, but these errors were encountered: