我正在使用React应用程序,我正在使用下一个js进行表达,我现在选择zeit来实现无服务,但是当我部署此面临的错误时错误:未构建无服务器页面
next.config.js
const configuration = withTypescript(
withLess({,
target: process.env.NODE_ENV === "development" ? "server" : "serverless",
cssModules: true,
lessLoaderOptions: {
javascriptEnabled: true,
modifyVars: themeVariables // make your antd custom effective
},
exportPathMap: async function(defaultPathMap) {
return {
"/": { page: "/index" },
};
},
webpack: config => {
config.plugins = config.plugins || [];
config.plugins = [
...config.plugins,
// Read the .env file
new Dotenv({
path: path.join(__dirname, "../.env"),
systemvars: true
})
];
return config;
},
})
);
module.exports = configuration;
使用下一个版本:“ @ types / next”:“ ^ 8.0.0”,
now.json
{
"version": 2,
"name": "web",
"builds": [
{ "src": "package.json", "use": "@now/next" }
],
}
内部包json
"scripts": {
"dev": "next src",
"build": "next build src",
"start": "next run build && next start src",
"export": "npm run build && next export src -o ./out",
"now-build": "next build src","
},
从立即Zeit 日志中获取错误
preparing lambda files...
2019-04-19T17:24:04.955Z Error: No serverless pages were built. https://err.sh/zeit/now-builders/now-next-no-serverless-pages-built
at Object.exports.build (/tmp/utils/build-module/node_modules/@now/next/index.js:305:13)
at <anonymous>
请在这里帮助我解决。 谢谢。