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

monorepo 仓库中Rax 组件打包报错 #374

Open
Nealyang opened this issue Jul 21, 2022 · 2 comments
Open

monorepo 仓库中Rax 组件打包报错 #374

Nealyang opened this issue Jul 21, 2022 · 2 comments

Comments

@Nealyang
Copy link

Do you want to request a feature or report a bug?
bug
What is the current behavior?

背景:icepkg 在 monorepo 仓库中初始化 rax 组件,依赖管理使用 yarn。依赖安装于 workspace,在执行对应包内的 start 命令报错如下:找不到 react/jsx-runtime 依赖。实则此依赖在项目中已安装,只不过不是在包内的 node_modules 中按照的。比较费解,看了下@ice/pkg-plugin-docusaurus 中对依赖的引用也没有什么特殊处理。

error msg

dependencies

framework

另外,如果我到对应包内安装依赖,对应包即可正常开发和发布。

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  • Iceworks CLI version:
  • Node verson:16.14.1
  • Platform:MacOS
  • tnpm version:9.1.6
  • npm version:8.14.0

What is the expected behavior?
依赖安装在 workspace 中(外层),组件可正常打包

@Nealyang
Copy link
Author

Nealyang commented Aug 5, 2022

https://github.com/ice-lab/icepkg/blob/main/packages/plugin-docusaurus/src/plugin.js#L31

像是这里写死原因

@luhc228
Copy link
Member

luhc228 commented Jan 18, 2023

https://github.com/ice-lab/icepkg/blob/main/packages/plugin-docusaurus/src/plugin.js#L31

像是这里写死原因

恩,看着应该是这里了。可以尝试用 require.resolve() 改一下。另外你能提供可复现的 demo 么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants