首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的next.config.js破坏了我的heroku构建?

为什么我的next.config.js破坏了我的heroku构建?
EN

Stack Overflow用户
提问于 2019-12-01 20:38:06
回答 1查看 540关注 0票数 0

我能够在本地运行该项目,但是自从我更改了next.config.js文件以包含@zeit/next-css之后,我的heroku构建就失败了,并给出了以下错误。

代码语言:javascript
复制
remote: Error: webpack build failed: found page without a React Component as default export in pages/gql/queries/age-ranges.js

这是我的配置文件的内容。这两个注释掉的部分是我尝试过的其他配置,也失败了。

next.config.js

代码语言:javascript
复制
const withImages = require('next-images');
const withCSS = require('@zeit/next-css');

module.exports = withCSS(withImages());

// ---- -----

// const withPlugins = require('next-compose-plugins');
// const withCSS = require('@zeit/next-css');
// const withImages = require('next-images');

// const nextConfig = {
//  useFileSystemPublicRoutes: false,
//  webpack: config => {
//      config.node = {
//          fs: 'empty',
//          modules: false
//      };

//      return config;
//  }
// };

// module.exports = withPlugins([withCSS, withImages], nextConfig);

// ----- synapse -----

// const withCSS = require('@zeit/next-css');
// const withImages = require('next-images');
// module.exports = withCSS(withImages());

// module.exports = withCSS(
//  withImages({
//      target: 'serverless',
//      webpack(config) {
//          config.module.rules.push({
//              test: /\.(png|svg|eot|otf|ttf|woff|woff2)$/,
//              use: {
//                  loader: 'url-loader',
//                  options: {
//                      limit: 8192,
//                      publicPath: '/_next/static/',
//                      outputPath: 'static/',
//                      name: '[name].[ext]'
//                  }
//              }
//          });
//          return config;
//      }
//  })
// );

/gql/queries/age-ranges.js

代码语言:javascript
复制
import gql from 'graphql-tag';

export const GET_AGE_RANGES = gql`
    query getAgeRanges {
        allAgeRanges {
            nodes {
                name
                nodeId
                id
            }
        }
    }
`;
EN

回答 1

Stack Overflow用户

发布于 2019-12-04 17:36:27

发现了问题。我导入的日历选择器CSS抛出了一个错误,但是当我更新到一个更最新的版本时,它被修复了。但是当我更新到下一个版本的“金丝雀”版本时,构建失败了,因为它们需要一个不同的文件结构。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59129744

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档