运行时错误:未捕获错误:模块解析失败:保留关键字“接口”

时间:2021-05-28 08:33:08

标签: next.js

我正在使用 next-compose-plugins,当我尝试构建 nextjs 应用程序时,它抛出错误:

<块引用>

运行时错误:未捕获的错误:模块解析失败:保留关键字“接口”。 您可能需要一个合适的加载器来处理此文件类型,目前没有配置加载器来处理此文件。

const nextConfig = {
  distDir: "../../build",
  async headers() {
    return [
      {
        source: '*',
        headers: [
          {
            key: 'x-custom-header',
            value: 'my custom header value',
          },
          {
            key: 'x-another-custom-header',
            value: 'my other custom header value',
          },
        ],
      },
    ]
  },
}
module.exports = withPlugins(
  [withCSS], [withSaas], [withImages], [nextSourceMaps], [withTM],
{
  webpack: (config, { isServer }) => {
    config.optimization.minimizer = [];
    config.optimization.minimizer.push(new OptimizeCSSAssetsPlugin({}));
    if (!isServer) {
      config.resolve.alias["@sentry/node"] = "@Sentry (Legacy)/browser";
    }
    return config;
  },
}, nextConfig);

我正在使用 react-jss,我认为这是我缺少的配置。我不确定我的配置有什么问题。任何帮助将不胜感激。谢谢。

0 个答案:

没有答案
相关问题