1.3.3
macOS 10.14, Firefox 66.0b1, Nuxt 2.4.0, Vue 2.4.0
https://github.com/LavraHQ/ant-design-vue-repro-window
Follow instructions in readme to start Nuxt project, navigate to localhost:3000, and the error will appear along with the stack trace pointing to antd.js as the issue.
Before using window, a check for if window is defined should be done, avoiding this issue for those who use Vue via SSR.
An error is displayed because window is attempted to be used prior to window being available.
This does not happen in 1.2.5, so I'm guessing it is something new in one of the latest commits. We can enable client-only rendering for ant-design-vue, however, if we do that the page will render once it is downloaded which causes the elements to look off for a few seconds and provides a bad user experience.
import Ant from 'ant-design-vue/lib'
This is because webpack issue.
@plunkettscott you can use import Ant from 'ant-design-vue/lib' like @UltimateLam.
In the next version, we will solve it.
@tangjinzhou it works but it when using all components. does not work when using import on demand.
Uncaught TypeError: Cannot read property 'install' of undefined
import {
Button,
Tooltip,
Table,
Pagination,
Form,
Input,
Icon,
Checkbox,
Spin,
Menu,
Layout,
Drawer,
Breadcrumbs
} from 'ant-design-vue/lib'
Vue.use(Button)
Vue.use(Tooltip)
Vue.use(Table)
Vue.use(Pagination)
Vue.use(Form)
Vue.use(Input)
Vue.use(Icon)
Vue.use(Checkbox)
Vue.use(Spin)
Vue.use(Menu)
Vue.use(Layout)
Vue.use(Drawer)
Vue.use(Breadcrumbs)
@jericopulvera Breadcrumb not Breadcrumbs
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
This is because webpack issue.
@plunkettscott you can use
import Ant from 'ant-design-vue/lib'like @UltimateLam.In the next version, we will solve it.