Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Button component throws error with SSR #320

Open
horprogs opened this issue Jun 30, 2019 · 1 comment
Open

Button component throws error with SSR #320

horprogs opened this issue Jun 30, 2019 · 1 comment
Assignees

Comments

@horprogs
Copy link

Describe the bug
Button component has window, and I get error ReferenceError: window is not defined on server-side.

Expected behavior
Component mustn't throw error in server-side.

Screenshots
image

The tenth line contains window in file node_modules/material-components-vue/dist/button/index.js.

I guess it happens, because target is web in webpack config.
I found similar discussion about it webpack/webpack#6522.
Also, I found your issue, where you set taget: node, but now I can't find this config (cfd1070).

@matsp
Copy link
Owner

matsp commented Jun 30, 2019

@horprogs Thanks for the hint. We must provide a module that is usable on server side. Maybe I switch to Rollup because it's better for bundling up libraries.

@matsp matsp self-assigned this Jun 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants