-
SummaryDear Friends, I have deployed NextJS app to GitHub Actions. The app deployed but Tailwind CSS not applied. See the page link : https://2div.github.io/nextjsmarketplace/ My repo link : https://github.com/2div/nextjsmarketplace kindly advise what is wrong with the app. Thank you Additional informationSee the page link : https://2div.github.io/nextjsmarketplace/
My repo link : https://github.com/2div/nextjsmarketplace Example |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
any advise on this issue ? |
Beta Was this translation helpful? Give feedback.
-
Looks like, neither the JS nor CSS are being loaded. At least they not reachable.... |
Beta Was this translation helpful? Give feedback.
-
@2div I got the issue Your app is deployed at: https://2div.github.io/nextjsmarketplace But next.js is building assuming you deploy at: https://2div.github.io/ You need to give it a basePath, or assetPrefix that applies only when You can reach your files at: https://2div.github.io/nextjsmarketplace/_next/static/css/a82f3a17bb8a8563.css, for example... /** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
basePath: process.env.NODE_ENV === 'production' ? '/nextjsmarketplace' : ''
};
export default nextConfig; |
Beta Was this translation helpful? Give feedback.
-
i am Facing the same issue in Newer version Deps DevDeps Deploye Scripts next.config.mjs
NOTE : && process.env.NODE_ENV , i applied after reading this Page. Deployed URL : https://rv-react-projects.github.io/ranvijay_portfolio/ I tried the Above solution but coudn't see any improvment, Please help.... |
Beta Was this translation helpful? Give feedback.
Image optimization requires a server, and when you use export mode there's no server running.
There's a list of unsupported features here: https://nextjs.org/docs/app/building-your-application/deploying/static-exports#unsupported-features
And image optimization with the default loader, is listed there. You could still use 3rd party to optimize them.
The thing is that in Github pages your page run in a sub-path of
*…