[Bug Report]: use builtins.presetEnv & antd-mobile@5 ActionSheet component; --> ERROR: [ Uncaught TypeError: Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method. ] #2618
Uncaught TypeError: Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.
at _nonIterableRest (_non_iterable_rest.mjs:2:1)
at _slicedToArray (_sliced_to_array.mjs:7:1)
at J (index.js:1:1)
at Popup (popup.js:31:1)
at renderWithHooks (react-dom.development.js:14803:1)
at mountIndeterminateComponent (react-dom.development.js:17482:1)
at beginWork (react-dom.development.js:18596:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:188:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237:1)
at invokeGuardedCallback (react-dom.development.js:292:1)
The above error occurred in the <Popup> component:
in Popup (created by ActionSheet)
in ActionSheet (at App.jsx>:31)
in div (at App.jsx>:17)
in App (at main.jsx>:7)
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
Uncaught TypeError: Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.
at _nonIterableRest (_non_iterable_rest.mjs:2:1)
at _slicedToArray (_sliced_to_array.mjs:7:1)
at J (index.js:1:1)
at Popup (popup.js:31:1)
at renderWithHooks (react-dom.development.js:14803:1)
at mountIndeterminateComponent (react-dom.development.js:17482:1)
at beginWork (react-dom.development.js:18596:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:188:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237:1)
at invokeGuardedCallback (react-dom.development.js:292:1)
System Info
System: OS: macOS 12.6 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 15.55 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v14.20.0/bin/yarn npm: 8.19.1 - ~/.nvm/versions/node/v14.20.0/bin/npm Browsers: Chrome: 111.0.5563.64 npmPackages: @rspack/cli: 0.1.6 => 0.1.6
Details
Reproduce link
https://github.com/lzsheng/lzs/tree/rspack-antd-mobile-v5
Reproduce Steps
init & run dev
yarn install
yarn dev
error condition
rspack.config.js
1、builtins.presetEnvApp.jsx
2、 import { ActionSheet } from "antd-mobile";demo
description:
If presetEnv is not configured, no error is reported
If ActionSheet is not used, no error is reported
rspack.config.js
package.json