我正在使用
NextJS
和 TailwindCSS
做一个项目,我想将其静态移动以将其托管在 apache server
上,但每次我尝试执行 “next build” 命令时,它都会生成以下错误:(我的文件 .tsx 中没有使用 useContext)
下一个配置:
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export'
};
export default nextConfig;
存储库:Github链接
对于 Github 中的项目,我做了 3 处更改并构建:
output: 'export'
添加到不在存储库中的下一个配置src/app/page.tsx
中,更改导入 Intro
组件时的大小写:import Intro from "@/components/Intro";
(或将文件名更改为 intro.tsx)"moduleResolution": "node",
<-- seems to be an issue in splidejs结果:
$ npm run build
> [email protected] build
> next build
▲ Next.js 14.2.14
Creating an optimized production build ...
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
✓ Generating static pages (4/4)
✓ Collecting build traces
✓ Finalizing page optimization
Route (app) Size First Load JS
┌ ○ / 29.6 kB 117 kB
└ ○ /_not-found 875 B 88.2 kB
+ First Load JS shared by all 87.3 kB
├ chunks/117-9c48060295ddae61.js 31.7 kB
├ chunks/fd9d1056-5af6eea51486f846.js 53.7 kB
└ other shared chunks (total) 1.95 kB
○ (Static) prerendered as static content