ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.1k stars 14.64k forks source link

[Bug Report] `TypeError: (0 , _deepmerge2.default) is not a function` on electron #7361

Closed ghost closed 6 years ago

ghost commented 6 years ago

Element UI version

1.4.6

OS/Browsers version

Linux Electron

Vue version

2.4.4

Reproduction Link

https://jsfiddle.net

Steps to reproduce

Sorry for no reproduction link, but the project is a company secret and I cant make an example on jsfiddle for electron.

I have a project for both web and electron with element 1.4. And the datepicker works in the browser, but not on electron. This is the code for the datepicker:

<el-date-picker
  :editable="false"
  :clearable="false"
  v-model="dateRange"
  :placeholder="$t('COMMON.CLICK_TO_CHOOSE')"
  type="daterange"
></el-date-picker>

Here is the webpack config for electron: https://pastebin.com/ahQ1bR05

And here is the web one: https://pastebin.com/Uin93Nde

What is Expected?

This is what it looks like in the browser, without any issues: https://i.imgur.com/zYoxZ5o.png

What is actually happening?

This is the issue in electron: https://i.imgur.com/oTB7Fk3.png

Together with these errors in the console: https://pastebin.com/qpkuM4jZ

I've narrowed it down to the element-ui/lib/locale/index.js file, where the _deepmerge2 variable is structured like this in the browser:

{
  default: function()...
}

And like this on electron:

{
  default: {
    default: function()...
  }
}

Electron seems to import the deepmerge module differently

Leopoldthecoder commented 6 years ago

I think this is more of an electron / CMD issue than an Element bug.