umi icon indicating copy to clipboard operation
umi copied to clipboard

[Bug] umi4.0 从第三方包引入了一个不存在的方法,仍然可以编译成功,只在运行时报错

Open PhilipDing opened this issue 5 months ago • 5 comments

What happens?

umi4.0 从第三方包引入了一个不存在的方法,仍然可以编译成功,只在运行时报错

Mini Showcase Repository(REQUIRED)

按照下述步骤即可复现该问题,期望是在编译时也能暴露出该问题,而不是仅在运行时报错。

How To Reproduce

  1. 创建项目,使用文档中的步骤即可。 pnpm dlx create-umi@latest

  2. 安装 lodash

    pnpm install lodash
    pnpm install @types/lodash -D
    
  3. 在项目的 Table/index.tsx 中引入第三方包中不存在的方法,并在组件中使用该方法。 image

  4. 在项目根目录执行 pnpm run build

能够正常编译 image

image

Context

@umijs/max: 4.3.19 Platform: Mac M1 Pro

PhilipDing avatar Sep 09 '24 06:09 PhilipDing