Skip to content
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

🧐[问题]按教程配置后依旧出现Global CSS cannot be imported from within node_modules #92

Open
johnwick115020115 opened this issue Feb 21, 2024 · 5 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@johnwick115020115
Copy link

🧐 问题描述

React18+nextjs12,按官方文档配置transpilePackages后,只要一使用Prochat组件就会报错

💻 示例代码

使用官方示例的代码没有改动

🚑 其他信息

image
image
image

@ONLY-yours
Copy link
Collaborator

教程中的是最新 nextjs 14 的版本,nextjs 12 还没试过,我看看哈 @johnwick115020115

@ONLY-yours ONLY-yours added bug Something isn't working documentation Improvements or additions to documentation labels Feb 21, 2024
@johnwick115020115
Copy link
Author

教程中的是最新 nextjs 14 的版本,nextjs 12 还没试过,我看看哈 @johnwick115020115

感谢,我也试过升级到next14但是一样报错,我对前端也不太熟,没法很好定位问题 :(

@ONLY-yours
Copy link
Collaborator

ONLY-yours commented Feb 21, 2024

个人感觉是老版本的 NextJS 的限制,不允许直接 import 'reactflow/dist/style.css'; ,我在新版本的 NextJS 13 和 14 情况下尝试都是ok的。(你可以拉取我们的 nextjs 14 的 demo 代码,直接 clone 安装就可以跑起来 )

还有就是你缺失了一个依赖,antd-styles 安装下,是 ProChat 的底层依赖呢。

 "antd-style": "^3.6.1",

具体要修复这个bug 我得先修一下 ProEditor 那边,可能时间会比较久

@johnwick115020115

@johnwick115020115
Copy link
Author

antd-style这个依赖有的,为了排查错误我给卸载掉了,但是有没有这个依赖都是这个错误,我等下再装一下 。
我也再试一次升级到next14看看有没有问题
@ONLY-yours

@johnwick115020115
Copy link
Author

johnwick115020115 commented Feb 21, 2024

我是基于https://github.com/transitive-bullshit/nextjs-notion-starter-kit 这个项目开发的,改动的范围很小。
刚才又测试了下,无论是原本的nextjs12还是升级到14,只要在这个项目里引入Prochat使用都会报一样的错误。
@ONLY-yours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants