简体   繁体   English

模块解析失败:使用 turbo repo 保留关键字“interface” Next.js 13

[英]Module parse failed: The keyword 'interface' is reserved using turbo repo Next.js 13

I am using Next.js 13 with turbo repo.. can any one solve this problem.我正在使用 Next.js 13 和 turbo repo.. 任何人都可以解决这个问题。 all components working fine with previous version on next.js...所有组件都可以在 next.js 上与以前的版本一起正常工作...

Module parse failed: The keyword 'interface' is reserved (10:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.模块解析失败:关键字“interface”已保留 (10:0) 您可能需要合适的加载器来处理此文件类型,目前没有配置加载器来处理此文件。 See https://webpack.js.org/concepts#loaders参见https://webpack.js.org/concepts#loaders

hra:dev: > interface Props { item?:any fieldname?: string hra:dev: > interface Props { item?:any fieldname?: 字符串

i have try all things like webpack modules.我已经尝试了 webpack 模块之类的所有东西。

from docs来自文档

Next.js will use Babel to handle TypeScript if.babelrc is present.如果 .babelrc 存在,Next.js 将使用 Babel 来处理 TypeScript。 This has some caveats and some compiler options are handled differently.这有一些注意事项,并且一些编译器选项的处理方式不同。

You either added a .babelrc or you modified next-env.d.ts file您添加了.babelrc或修改了next-env.d.ts文件

/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited

If you set your app npx create-next-app choosing typescrip option, settngs are correct with ts如果您设置您的应用程序 npx npx create-next-app选择打字稿选项,则设置与 ts 是正确的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM