Open ripple666 opened 6 years ago
@ripple-xaz https://github.com/eleme/element-react/issues/516 似乎一直没有解决
Seems to work ok if you wrap the element component in another component and then import it dynamically. e.g.
import dynamic from 'next/dynamic'
const MySelect = dynamic(import('../../components/ui/my-select/MySelect'))
Description
引入模块的时候就开始报错:
ReferenceError: window is not defined at D:\project\dapp\dpark-react\node_modules\element-react\dist\npm\es5\libs\utils\popper.js:57:16 at root (D:\project\dapp\dpark-react\node_modules\element-react\dist\npm\es5\libs\utils\popper.js:48:26) at Object.<anonymous> (D:\project\dapp\dpark-react\node_modules\element-react\dist\npm\es5\libs\utils\popper.js:53:3) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3) at Module.require (module.js:579:17) at require (internal/module.js:11:18) at Object.<anonymous> (D:\project\dapp\dpark-react\node_modules\element-react\dist\npm\es5\libs\utils\popper-mixins.js:18:15) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3)
Reproduce Steps
Error Trace (if possible)
It's better to post up the error stack for us to trace this issue.
Solution
What needs to be done to address this issue? Ideally, provide a pull request with a fix.
Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.