NextJS 13部署GitHub Pages后Safari路由切换图片加载404问题
NextJS 13部署GitHub Pages后Safari路由切换图片404问题
问题现象
将简易NextJS 13站点部署到GitHub Pages后,仅在Safari(iOS及MacOS)出现异常:初始加载时图片显示正常,但路由切换后图片返回404错误。
Safari异常演示

Chrome正常演示

相关信息
- GitHub仓库地址:github.com/ayush-lal/boilerplate-nextjs
- 当前
next.config.js配置代码:
// next.config.js /** @type {import('next').NextConfig} */ const repo = "boilerplate-nextjs"; const assetPrefix = `/${repo}/`; const basePath = `/${repo}`; const nextConfig = { trailingSlash: true, output: "export", basePath: basePath, assetPrefix: assetPrefix, images: { unoptimized: true, }, }; module.exports = nextConfig;
内容的提问来源于stack exchange,提问作者ayush
相关产品推荐
相关产品推荐

