-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
next13中from组件报错 #6251
Comments
提供一下重现看看? |
@zombieJ 以及我跟着一切方法改了我的tsconfig文件,它现在是
`{
"extends": "tsconfig/nextjs.json",
"compilerOptions": {
"plugins": [
{
"name": "next"
}
],
"strict": true,
"allowJs": true,
"esModuleInterop": true,
"skipLibCheck": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"isolatedModules": true,
"target": "esnext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"jsx": "preserve",
"module": "esnext",
"moduleResolution": "node",
"noEmit": true
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"../../packages/api",
"node_modules/antd-mobile"
],
"exclude": [
"node_modules"
]
}`
,next.config中我也配置了 transpilePackages: ["antd-mobile"], |
Hi, yangjianguo12. Please provide a online reproduction so that we can help you troubleshoot the problem. You can create a demo by codesandbox or stackblitz. 我们需要你提供一个在线的重现实例,以便于我们帮你排查问题。你可以通过 codesandbox 或 stackblitz 创建一个实例。 |
我试了下正常的,所以提供下复现的代码 or 仓库看看 |
我试了一下找到了原因,似乎是我的_app.tsx文件用了国际化组件引起的,这是我的代码, `import "../styles/globals.css"; function MyApp({ Component, pageProps }: AppProps) { // useEffect(() => { useEffect(() => { return ( export default appWithTranslation(MyApp); ` 只要我去掉ConfigProvider标签才会好。。。请问可以帮忙看一下吗? |
从你提供代码片段里,并没有消费 请提供完整的、在线的复现实例,你可以通过 codesandbox 或 stackblitz 创建 这个 issue 我先关了,有复现实例贴出来我会继续排查 |
https://codesandbox.io/embed/gifted-meitner-kwx95c?fontsize=14&hidenavigation=1&theme=dark @miracles1919 复现在这里。 并且我通过setDefaultConfig已经解决了这个问题,非常感谢你 |
const [antLocal, setantLocal] = useState(zhCN); |
Version of antd-mobile
5.32.0
Operating system and its version
No response
Browser and its version
No response
Sandbox to reproduce
No response
What happened?
"dependencies": {
"@ant-design/icons": "^5.1.4",
"antd-mobile": "^5.32.0",
"api": "",
"axios": "^1.4.0",
"common": "",
"constants": "",
"cookies-next": "^2.1.2",
"dayjs": "^1.11.8",
"eslint": "8.43.0",
"eslint-config-next": "13.4.6",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-sonarjs": "^0.19.0",
"i18next": "^23.2.8",
"next": "^13.4.1",
"next-i18next": "^14.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-i18next": "^13.0.2",
"utils": ""
},
"devDependencies": {
"@types/node": "^17.0.12",
"@types/react": "^18.0.22",
"@types/react-dom": "^18.0.7",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"eslint-config-custom": "",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"sass": "^1.63.5",
"tsconfig": "",
"typescript": "^4.5.3"
}
我的依赖文件
Relevant log output
The text was updated successfully, but these errors were encountered: