英文:
How to fix error during build of next js and Mui?
问题
我已安装npm install @mui/material @emotion/react @emotion/server
并尝试构建Next.js应用程序,在进行linting和类型检查期间收到了错误。
info - Linting and checking validity of types ...Failed to compile.
./node_modules/@mui/base/useMenu/useMenu.d.ts:3:15
Type error: ',' expected.
1 | import { MenuItemMetadata, UseMenuListboxSlotProps, UseMenuParameters } from ' ./useMenu.types';
2 | import { EventHandlers } from ' ../utils';
> 3 | import { type MenuUnstyledContextType } from ' ../MenuUnstyled';
| ^
4 | /**
5 | *
感谢你的帮助。
EsLint配置
{
"extends": ["next/core-web-vitals", "prettier"],
"rules": {
"object-curly-newline": [
"error",
{
"ObjectExpression": {
"minProperties": 1
}
}
],
"arrow-body-style": ["error", "as-needed"],
"@next/next/no-img-element": "off"
}
}
英文:
I have installed npm install @mui/material @emotion/react @emotion/server
and have tried to build next js app and received an error during linting and checking
info - Linting and checking validity of types ...Failed to compile.
./node_modules/@mui/base/useMenu/useMenu.d.ts:3:15
Type error: ',' expected.
1 | import { MenuItemMetadata, UseMenuListboxSlotProps, UseMenuParameters } from './useMenu.types';
2 | import { EventHandlers } from '../utils';
> 3 | import { type MenuUnstyledContextType } from '../MenuUnstyled';
| ^
4 | /**
5 | *
Thanks for your help.
EsLint config
{
"extends": ["next/core-web-vitals", "prettier"],
"rules": {
"object-curly-newline": [
"error",
{
"ObjectExpression": {
"minProperties": 1
}
}
],
"arrow-body-style": ["error", "as-needed"],
"@next/next/no-img-element": "off"
}
}
答案1
得分: 1
我已经弄清楚如何解决我的项目问题,这可能也会帮助到其他人。我的TypeScript版本是4.4.9,我已经更改为4.5.2,并且代码检查通过了。
英文:
I have figured our how to fix my project problem and possibly that will help others as well. I have typescript version 4.4.9 I changed to 4.5.2 and linting passed correctly
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论