mazipan / vue-currency-filter

🍒 Lightweight vue currency filter based on accounting.js
https://mazipan.github.io/vue-currency-filter/
MIT License
246 stars 29 forks source link

Not usable with SSR since v2.2 #20

Closed Sopamo closed 6 years ago

Sopamo commented 6 years ago

It seems like the switch to webpack 4 made it so that this package doesn't work with Server Side Rendering any more, because in the dist file a window object is inserted, which doesn't exist in node applications.

mazipan commented 6 years ago

Hmmm, I think it's related with umd module that I choose ya ? Will find the solution.

mazipan commented 6 years ago

Can you help me @Sopamo to validated this changes. You can install newest version. Hope it will solve this issue.

Sopamo commented 6 years ago

Thanks for answering so quickly! The window issue is gone, but the filter isn't registered at all now. I built a small reproduction for you:

https://codesandbox.io/s/oom7p2y2y9

You can see in the console (in the bottom bar) that the currency filter isn't available.

mazipan commented 6 years ago

Hmmm, embarrassing 😅 I will try to find another solution

Anatolie commented 6 years ago

Having the same issue in my project as well. Currency filter is no longer recognized, output in console:

[Vue warn]: Failed to resolve filter: currency

benomas commented 6 years ago

"Vue warn]: Failed to resolve filter: currency" Same error over here

mazipan commented 6 years ago

Please downgrade to 2.2.0 first. While I tried to find root cause.

niklv commented 6 years ago

Workaround: import VueCurrencyFilter from 'vue-currency-filter/VueCurrencyFilter';

mazipan commented 6 years ago

Can you try with version 2.2.4 @Niklv @benomas @Anatolie @Sopamo

https://codesandbox.io/s/xvo87491vw

Sopamo commented 6 years ago

Yep, that fixed it. Thanks a lot!