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

tdesign 组件库与包自动引入冲突 #71

Closed
zanderzhg opened this issue Jun 5, 2023 · 5 comments
Closed

tdesign 组件库与包自动引入冲突 #71

zanderzhg opened this issue Jun 5, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@zanderzhg
Copy link

信息

nodejs 版本

18.15.0

(推荐使用 v18 以上)


包管理器及其版本

pnpm 8.13.2

(请使用 pnpm)


系统

win11

(该项目开发环境系统为 win11)



bug

描述

<script setup lang='ts'>
import type { PrimaryTableCol, TableRowData } from 'tdesign-vue-next'

const columns: Array<PrimaryTableCol<TableRowData>> = [
  { colKey: 'name', title: 'name' },
  { colKey: 'name1', title: 'name1' },
  { colKey: 'name2', title: 'name2' },
].map(it => ({ ...it, align: 'center' }))
</script>

<template>
  <div><t-table :columns="columns" /></div>
</template>

老师,这段代码。我用Vitesse就没问题,但是使用咱们的报错,错误提示是:
`chunk-TBCSS62C.js?v=caf2dfd6:9 Module "util" has been externalized for browser compatibility. Cannot access "util.inspect" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
get @ browser-external:util:9
(匿名) @ loupe.js:682
(匿名) @ loupe.js:2
node_modules/.pnpm/loupe@2.3.6/node_modules/loupe/loupe.js @ loupe.js:5
__require @ chunk-TBCSS62C.js?v=caf2dfd6:9
(匿名) @ index.js:7
browser-external:util:9 Module "util" has been externalized for browser compatibility. Cannot access "util.inspect" in client code. See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
get @ browser-external:util:9
(匿名) @ index.js:125
__x00__virtual:modules:19 [Vue Router warn]: Unexpected error when starting the router: Error: Vitest failed to access its internal state.

One of the following is possible:

  • "vitest" is imported directly without running "vitest" command

  • "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)

  • Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues

    at createVitest (vendor-vi.23b98fa1.js:3129:11)
    at vendor-vi.23b98fa1.js:3321:16
    warn @ vue-router.mjs:35
    (匿名) @ vue-router.mjs:3553
    Promise.catch(异步)
    install @ vue-router.mjs:3551
    use @ runtime-core.esm-bundler.js:3752
    (匿名) @ __x00__virtual:modules:19
    useModules @ __x00__virtual:modules:6
    (匿名) @ main.ts:13
    setTimeout(异步)
    (匿名) @ __uno.css:20
    (匿名) @ __uno.css:20
    Show 4 more frames`


预期结果

TODO


最小测试仓库

TODO

@markthree markthree self-assigned this Jun 5, 2023
@markthree markthree added the bug Something isn't working label Jun 5, 2023
@markthree markthree changed the title map报错。 tdesign 组件库与包自动引入冲突 Jun 5, 2023
@markthree
Copy link
Member

@markthree
Copy link
Member

markthree commented Jun 5, 2023

@zanderzhg 靓仔你好,该问题已解决,请重新下载,或 pull 拉取模板,并重新执行 pnpm install 即可

@zanderzhg
Copy link
Author

@zanderzhg 靓仔你好,该问题已解决,请重新下载,或 pull 拉取模板,并重新执行 pnpm install 即可

谢谢

@zanderzhg
Copy link
Author

我把vitest 删除就没问题了,

@markthree
Copy link
Member

我把vitest 删除就没问题了,

也可以这样做 👍

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

No branches or pull requests

2 participants