alibaba / lowcode-engine

An enterprise-class low-code technology stack with scale-out design / 一套面向扩展设计的企业级低代码技术体系
https://lowcode-engine.cn
MIT License
14.66k stars 2.55k forks source link

/@alilc/lowcode-renderer-core/es/components/VisualDom/index.css 在nextjs项目中使用报错,Global CSS cannot be imported from within node_modules. #2472

Open wumengmeng opened 1 year ago

wumengmeng commented 1 year ago

/@alilc/lowcode-renderer-core/es/components/VisualDom/index.css 在nextjs项目中使用报错,Global CSS cannot be imported from within node_modules.

./nodemodules/.pnpm/@alilc+lowcode-renderer-core@1.1.9@alifd+meet-react@2.9.0_moment@2.29.4_react-dom@18.2.0/node_modules/@alilc/lowcode-renderer-core/es/components/VisualDom/index.css Global CSS cannot be imported from within node_modules. Read more: https://nextjs.org/docs/messages/css-npm Location: nodemodules/.pnpm/@alilc+lowcode-renderer-core@1.1.9@alifd+meet-react@2.9.0_moment@2.29.4_react-dom@18.2.0/node_modules/@alilc/lowcode-renderer-core/es/components/VisualDom/index.js

Import trace for requested module:


创建nextjs项目引入低代码引擎

期望样式用户自己在项目中引入,因为nextjs在做服务端渲染时水合不一致

A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为


liujuping commented 1 year ago

这个问题这里有讨论:https://github.com/vercel/next.js/issues/19936

使用的框架不应该限制第三方是否导入 css,并且后续 next 也支持第三方导入 css 了: https://github.com/vercel/next.js/discussions/27953#discussioncomment-3978605