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

v5.12.7 之后的版本都无法在 pnpm hoist:false 下通过 vite 编译 #47569

Closed
liuweiGL opened this issue Feb 23, 2024 · 0 comments · Fixed by #47587
Closed

v5.12.7 之后的版本都无法在 pnpm hoist:false 下通过 vite 编译 #47569

liuweiGL opened this issue Feb 23, 2024 · 0 comments · Fixed by #47587

Comments

@liuweiGL
Copy link

Reproduction link

https://github.com/liuweiGL/antd-babel_runtime

Steps to reproduce

  1. git clone https://github.com/liuweiGL/antd-babel_runtime
  2. cd antd-babel_runtime
  3. pnpm i
  4. pnpm dev

What is expected?

能正常运行

What is actually happening?

编译报错:

VITE v5.1.4  ready in 148 ms

  ➜  Local:   http://localhost:9090/
  ➜  Network: use --host to expose
  ➜  press h   enter to show help
✘ [ERROR] Could not resolve "@babel/runtime/helpers/esm/classCallCheck"

    ../../node_modules/.pnpm/antd@5.14.2_react-dom@18.2.0_react@18.2.0/node_modules/antd/es/alert/ErrorBoundary.js:3:28:      3 │ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
        ╵                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@babel/runtime/helpers/esm/classCallCheck" as external to exclude it from
  the bundle, which will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@babel/runtime/helpers/esm/toConsumableArray"

    ../../node_modules/.pnpm/antd@5.14.2_react-dom@18.2.0_react@18.2.0/node_modules/antd/es/watermark/index.js:3:31:
      3 │ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
        ╵                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@babel/runtime/helpers/esm/toConsumableArray" as external to exclude it
  from the bundle, which will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@babel/runtime/helpers/esm/toConsumableArray"

    ../../node_modules/.pnpm/antd@5.14.2_react-dom@18.2.0_react@18.2.0/node_modules/antd/es/cascader/index.js:3:31:
      3 │ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
        ╵                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@babel/runtime/helpers/esm/toConsumableArray" as external to exclude it
  from the bundle, which will remove this error and leave the unresolved path in the bundle.

✘ [ERROR] Could not resolve "@babel/runtime/helpers/esm/toConsumableArray"

    ../../node_modules/.pnpm/antd@5.14.2_react-dom@18.2.0_react@18.2.0/node_modules/antd/es/modal/useModal/index.js:3:31:
      3 │ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
        ╵                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@babel/runtime/helpers/esm/toConsumableArray" as external to exclude it
  from the bundle, which will remove this error and leave the unresolved path in the bundle.
Environment Info
antd 5.14.2
React 18.2.0
System Windows11
Browser Chrome 99.0.4844.51

15c2051 提交不知道为什么把 @bable/runtime 移除了

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

Successfully merging a pull request may close this issue.

1 participant