小编Roo*_*man的帖子

UnhandledPromiseRejectionWarning: TypeError: 无法读取 antd 和 nextjs 中未定义的属性“startsWith”

我使用所有最新版本的 ant design 设置了我的 nextjs 项目。当我尝试配置next.config.js文件时,会抛出此错误。更具体地说,当我添加 webpack 配置时会发生错误。

 next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
Warning: Built-in CSS support is being disabled due to custom CSS configuration being detected.
See here for more info: https://nextjs.org/docs/messages/built-in-css-disabled

(node:7620) [DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader
(node:7620) [DEP_WEBPACK_MAIN_TEMPLATE_RENDER_MANIFEST] DeprecationWarning: MainTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)
(node:7620) [DEP_WEBPACK_CHUNK_TEMPLATE_RENDER_MANIFEST] DeprecationWarning: ChunkTemplate.hooks.renderManifest is deprecated (use Compilation.hooks.renderManifest instead)
(node:7620) [DEP_WEBPACK_MAIN_TEMPLATE_HASH_FOR_CHUNK] DeprecationWarning: MainTemplate.hooks.hashForChunk …
Run Code Online (Sandbox Code Playgroud)

webpack next.js antd

6
推荐指数
0
解决办法
559
查看次数

标签 统计

antd ×1

next.js ×1

webpack ×1