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

执行 npm run build 失败 #362

Open
1 task
JovenGeek opened this issue Jan 24, 2024 · 3 comments
Open
1 task

执行 npm run build 失败 #362

JovenGeek opened this issue Jan 24, 2024 · 3 comments

Comments

@JovenGeek
Copy link

基本信息

现有案例

PS E:\projects\vscode_projects\test\arco_test\hello-arco-pro> npm run build

arco-design-pro-vue@1.0.0 build
vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts

src/components/menu/index.vue:102:19 - error TS2339: Property 'a-sub-menu' does not exist on type 'JSX.IntrinsicElements'.

102 <a-sub-menu
~~~~~~~~~~~
103 key={element?.name}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
107 }}
~~~~~~~~~~~~~~~~~~~~~~
108 >
~~~~~~~~~~~~~~~~~~~

src/components/menu/index.vue:110:19 - error TS2339: Property 'a-sub-menu' does not exist on type 'JSX.IntrinsicElements'.

110
~~~~~~~~~~~~~

src/components/menu/index.vue:112:19 - error TS2339: Property 'a-menu-item' does not exist on type 'JSX.IntrinsicElements'.

112 <a-menu-item
~~~~~~~~~~~~
113 key={element?.name}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
115 onClick={() => goto(element)}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116 >
~~~~~~~~~~~~~~~~~~~

src/components/menu/index.vue:118:19 - error TS2339: Property 'a-menu-item' does not exist on type 'JSX.IntrinsicElements'.

118
~~~~~~~~~~~~~~

src/components/menu/index.vue:129:9 - error TS2339: Property 'a-menu' does not exist on type 'JSX.IntrinsicElements'.

129 <a-menu
~~~~~~~
130 mode={topMenu.value ? 'horizontal' : 'vertical'}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
139 onCollapse={setCollapse}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140 >
~~~~~~~~~

......

Found 10 errors in 3 files.

Errors Files
6 src/components/menu/index.vue:102
2 src/views/profile/basic/components/profile-item.vue:59
2 src/views/visualization/data-analysis/components/chain-item.vue:43

预期解决问题

在执行 npm run build 时出现 jsx 错误

@yhysir
Copy link

yhysir commented Mar 14, 2024

一样,按官方文档安装的项目,一个标点符号都没改,运行npm run build就报这个错,官方自己都不测试好就发出来?

@xiarunsheng
Copy link

这个问题我也遇到了,通过查找资料解决了,分享一下。
一、针对 src/components/menu/index.vue:102这个问题的处理:
修改tsconfig.json
将strict改成false,添加noImplicitAny这个项配置。
{
"compilerOptions": {
"strict": false,
"noImplicitAny": false, // 是否在表达式和声明上有隐含的any
}
}

二、针对 src/views/visualization/data-analysis/components/chain-item.vue:43
在chain-item.vue里修改两处。
series数据结构里data,改成data: data.value[0],
你说的另外一个我这里没有发生错误。

这样改后可以编译过去,但是会不会导致其他什么问题还不清楚。

@amendge
Copy link

amendge commented Jul 10, 2024

报错一样,真的服了,连特么社区都没有。垃圾产品开源出来干嘛

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