-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 1.13.0 broke SSR #67
Comments
Hm that is weird. I have it running in an older nuxt project with the But I will look into this. |
Precision, just the import trigger the error. Don't even need to add the component. |
Might be related to the new webpack 4 build setup. Comparing v.1.12 (function webpackUniversalModuleDefinition(root, factory) {
--
7 | if(typeof exports === 'object' && typeof module === 'object')
8 | module.exports = factory();
9 | else if(typeof define === 'function' && define.amd)
10 | define("CookieLaw", [], factory);
11 | else if(typeof exports === 'object')
12 | exports["CookieLaw"] = factory();
13 | else
14 | root["CookieLaw"] = factory();
15 | })(this, function() { and v.1.13 (function webpackUniversalModuleDefinition(root, factory) {
--
7 | if(typeof exports === 'object' && typeof module === 'object')
8 | module.exports = factory();
9 | else if(typeof define === 'function' && define.amd)
10 | define("CookieLaw", [], factory);
11 | else if(typeof exports === 'object')
12 | exports["CookieLaw"] = factory();
13 | else
14 | root["CookieLaw"] = factory();
15 | })(window, function() { It looks like |
Further issues with 1.13.3 SSR build:
|
Same here |
Please use the old version for now. It is still a webpack build issue. Need to investigate further. |
Already have it locked to 1.12.0 in my project, for the time being. Thanks for looking into this. |
Not sure it's the best solution, but a workaround : let CookieLaw;
if (process.client) {
CookieLaw = require("vue-cookie-law").default;
} |
I can confirm that this is a huge problem. Nuxt and Vue users can't use this plugin, anymore. Please fix it soon :))
Another, failing solutionSo, I tried to load it dynamically, but still get an error:
Error message
|
Looks like this option should be set to default 'window' vue-cookie-law/build/webpack.release.js Line 33 in eb35aa3
|
Sadly nope. I had to set this to And the webpack config also confirms this: https://webpack.js.org/configuration/output/#outputglobalobject
The current error has something to do with the styles that get injected. But I need to investigate further. |
I'll try to debug it. |
Thanks that would be great. I am currently very low on time. The issue in general is, that the dynamic style loading of webpack breaks. However this would be a breaking change. Thats why I was looking for other solutions to this. However, it there are not other solutions I would go with the extracting of css. |
Thanks for looking into this.
I assumed that having a separate css file is how it should be anyways (like
the majority of 3rd party components I use in my project). Due to it being
a breaking change, couldn't it simply be released as a new major version?
…On Mon, 11 May 2020 at 05:45, Jakub ***@***.***> wrote:
Thanks that would be great. I am currently very low on time.
The issue in general is, that the dynamic style loading of webpack breaks.
An easy'ish workaround would be to extract the CSS so people have to
import it, themself.
However this would be a breaking change. Thats why I was looking for other
solutions to this. However, it there are not other solutions I would go
with the extracting of css.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#67 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAWU3VT3RLO25JMXCIMJV3RQ7JLJANCNFSM4LZW36IA>
.
|
This works for me:
|
@tre-dev This works indeed. Small precision, |
@tre-dev I use Gridsome (so my Vue knowledge is probably less than that of Nuxt.js users), but I should be able to translate that. |
you can try dynamic import:
|
By the way, for people using basic Vue SSR without Nuxt.js, you must put the following (the declaration) into the
And in your component template (PUG style):
|
works also with nuxt |
nuxt 2.12.2
vue 2.6.11
vue-cookie-law 1.13.2
Prior to version 1.13.0 I was using this plugin with Nuxt, and it was working perfectly. Nuxt render pages server-side, so I had to put the
<vue-cookie-law>
component in a<client-only>
tag, like this:With this new version, it is not working anymore, as I'm getting this error:
Here a repro link with the version 1.13.2 installed: https://codesandbox.io/s/old-water-s4p24
The text was updated successfully, but these errors were encountered: