ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.63k stars 2.4k forks source link

nextjs 无法整合 antd-mobile 5 版本,css 引入错误 #5104

Closed aqnaruto closed 2 years ago

aqnaruto commented 2 years ago

Version of antd-mobile

5.10.3

Operating system and its version

Others

Browser and its version

No response

Sandbox to reproduce

No response

What happened?

引入css错误,官方文档中写的时 引入antd.module.css 可是根本没有这个文件现在 引入这个 于是报错 image

这是我的next.config.js image

这是我的package.json

    "dependencies": {
        "antd-mobile": "^5.10.3",
        "autoprefixer": "^9.1.5",
        "axios": "^0.21.4",
        "babel-plugin-module-resolver": "^3.1.1",
        "babel-plugin-wrap-in-js": "^1.1.1",
        "copy-to-clipboard": "^3.2.0",
        "crypto-js": "^4.0.0",
        "debounce": "^1.2.0",
        "isomorphic-unfetch": "^3.0.0",
        "js-base64": "^3.6.2",
        "lottery-turntable": "^1.3.6",
        "moment": "^2.24.0",
        "next": "12.1.0",
        "next-compose-plugins": "^2.2.0",
        "node-sass": "^4.13.0",
        "null-loader": "^3.0.0",
        "postcss-easy-import": "^3.0.0",
        "postcss-loader": "^3.0.0",
        "postcss-plugin-pxtorem": "0.0.1",
        "qrcode": "^1.3.3",
        "rc-async-component": "^1.1.7",
        "rc-dropdown": "^3.0.0-alpha.0",
        "rc-menu": "^8.0.0-alpha.5",
        "rc-scroll-anim": "^2.7.4",
        "rc-tween-one": "^2.7.3",
        "rc-upload": "^4.3.1",
        "react": "^16.12.0",
        "react-card-carousel": "^1.1.3",
        "react-dom": "^16.12.0",
        "react-iframe": "^1.8.0",
        "react-image-lazy-load": "^1.3.0",
        "react-lazyload": "^3.2.0",
        "react-loading-skeleton": "^2.1.1",
        "react-turnplate": "^1.9.0",
        "react-turntable": "^1.3.1",
        "sass-loader": "^7.1.0",
        "social-share-react": "^1.1.2"
    },
    "devDependencies": {
        "babel-plugin-import": "^1.12.2",
        "babel-plugin-transform-remove-console": "^6.9.4",
        "next-images": "^1.8.4",
        "next-transpile-modules": "^9.0.0",
        "next-with-less": "^2.0.5",
        "webpack": "^4.41.2"
    },

Relevant log output

Error: An unknown PostCSS plugin was provided ([object Object]).
Read more: https://nextjs.org/docs/messages/postcss-shape
error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[2].oneOf[7].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[2].oneOf[7].use[2]!./node_modules/antd-mobil
e/bundle/style.css
awmleer commented 2 years ago

看起来报错是 An unknown PostCSS plugin was provided ([object Object]) 似乎是你 postcss 插件配置的问题?要不你把完整的项目打个包上传一下?

awmleer commented 2 years ago

由于未能收到回复,issue 先关闭了