Next.js 运行时错误:未捕获错误:模块解析失败:关键字';接口';保留
我正在使用Next.js 运行时错误:未捕获错误:模块解析失败:关键字';接口';保留,next.js,Next.js,我正在使用next compose plugins,当我尝试构建nextjs应用程序时,它抛出错误: 运行时错误:未捕获错误:模块分析失败:保留关键字“interface”。 您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件 我正在使用react jss,我认为这就是我缺少配置的原因。我不确定我的配置出了什么问题。任何帮助都将不胜感激。谢谢。闻起来像是在JS中加载了一些TypeScript,如果您删除withPlugins,它会工作吗? const nextConfig
next compose plugins
,当我尝试构建nextjs应用程序时,它抛出错误:
运行时错误:未捕获错误:模块分析失败:保留关键字“interface”。
您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件
我正在使用
react jss
,我认为这就是我缺少配置的原因。我不确定我的配置出了什么问题。任何帮助都将不胜感激。谢谢。闻起来像是在JS中加载了一些TypeScript,如果您删除withPlugins,它会工作吗?
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);