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

[Form] 组件在 Nuxt3 build 时报错:The symbol "isError" has already been declared #3458

Closed
miswanting opened this issue Oct 11, 2023 · 9 comments
Assignees
Labels
issueShoot 上架到腾讯内部issueshoot平台的任务 nuxt3 a nuxt3 issue to be published to be published

Comments

@miswanting
Copy link

miswanting commented Oct 11, 2023

tdesign-vue-next 版本

1.7.1

重现链接

https://github.com/miswanting/nuxt3-build-tdesign-iserror-already-been-declared-bug
更加精准的重现:https://codesandbox.io/p/devbox/nuxt3-build-tdesign-vue-next-iserror-already-been-declared-bug-f8ql3d

重现步骤

pnpm i
pnpm nuxt build

期望结果

编译无错误

实际结果

编译中断,报错:

 ERROR  Error: Transform failed with 1 error:                 nitro 2:21:03 AM
/workspaces/sandbox/.nuxt/dist/server/_nuxt/index-e3e9d414.js:4312:170: ERROR: The symbol "isError" has already been declared


The symbol "isError" has already been declared


 ERROR  Transform failed with 1 error:                              2:21:03 AM
/workspaces/sandbox/.nuxt/dist/server/_nuxt/index-e3e9d414.js:4312:170: ERROR: The symbol "isError" has already been declared

  .nuxt/dist/server/_nuxt/index-e3e9d414.js:4312:170: ERROR: The symbol "isError" has already been declared
  at failureErrorWithLog (node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1650:15)
  at node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:848:29
  at responseCallbacks.<computed> (node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:703:9)
  at handleIncomingPacket (node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:763:9)
  at Socket.readFromStdout (node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:679:7)
  at Socket.emit (node:events:514:28)
  at addChunk (node:internal/streams/readable:376:12)
  at readableAddChunk (node:internal/streams/readable:349:9)
  at Readable.push (node:internal/streams/readable:286:10)
  at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) 



 ERROR  Transform failed with 1 error:                              2:21:03 AM
/workspaces/sandbox/.nuxt/dist/server/_nuxt/index-e3e9d414.js:4312:170: ERROR: The symbol "isError" has already been declared

 ELIFECYCLE  Command failed with exit code 1.

框架版本

Nuxt(3.8.1)

浏览器版本

No response

系统版本

No response

Node版本

20.5.1

补充说明

  • dev模式时无报错;
  • 仅有pages/目录中的文件会出现该报错,app.vue中不会出现这个问题;
  • 该bug确认到两个症状:
    1. Bug 1:直接使用Form组件会报错;【该Bug可用ClientOnly绕过】
    2. Bug 2:在Layout组件中使用Form组件会报错;【该Bug可用ClientOnly绕过】
  • 该bug影响很大,导致tdsign-vue-next几乎无法在Nuxt3框架中完成构建和发布。
@github-actions
Copy link
Contributor

👋 @miswanting,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@miswanting miswanting changed the title [组件名称] 描述问题的标题 Nuxt3 build时报错:The symbol "isError" has already been declared Oct 11, 2023
@wangzhishou
Copy link

wangzhishou commented Nov 4, 2023

我也复现了这个问题,简直没办法用啊,

补充说明
dev模式时无问题

@wangzhishou
Copy link

wangzhishou commented Nov 4, 2023

<template><t-form> </t-form></template>

直接这样build就报错,是t-form的锅

@wangzhishou
Copy link

wangzhishou commented Nov 5, 2023

实测在包含t-form组件的页面,preRender时候报错,可以外加<client-only>包裹先避免。

@uyarn uyarn added nuxt3 a nuxt3 issue issueShoot 上架到腾讯内部issueshoot平台的任务 labels Nov 24, 2023
@miswanting miswanting changed the title Nuxt3 build时报错:The symbol "isError" has already been declared [Form] 组件在 Nuxt3 build 时报错:The symbol "isError" has already been declared Dec 10, 2023
@miswanting
Copy link
Author

更新:v1.7.1依然存在这个问题。

存在两类Bug,其中一个可用ClientOnly组件绕过,但另一个无法用该方法绕过。【相关信息已在原文中更新,并附上了精简版重现链接】

Bug 1:/pages/bug-1.vue

<template>
  <!-- 使用 ClientOnly **可绕过**该问题 -->
  <!-- <ClientOnly> -->
  <TForm></TForm>
  <!-- </ClientOnly> -->
</template>

Bug 2:/pages/bug-2.vue

<template>
  <TLayout>
    <!-- 使用 ClientOnly **不可绕过**该Bug -->
    <ClientOnly>
      <TForm></TForm>
    </ClientOnly>
  </TLayout>
</template>

Copy link
Contributor

♥️ 有劳 @LeeJim @PengYYYYY @k1nz 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @miswanting

1 similar comment
Copy link
Contributor

♥️ 有劳 @LeeJim @PengYYYYY @k1nz 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @miswanting

@uyarn
Copy link
Collaborator

uyarn commented Feb 27, 2024

问题已修复 下个版本带上 thanks @richardji202 🌹

@uyarn uyarn added the to be published to be published label Feb 27, 2024
@uyarn
Copy link
Collaborator

uyarn commented Mar 8, 2024

fixed 1.9.0

@uyarn uyarn closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issueShoot 上架到腾讯内部issueshoot平台的任务 nuxt3 a nuxt3 issue to be published to be published
Projects
None yet
Development

No branches or pull requests

5 participants