-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
ReferenceError: window is not defined #41
Comments
Ask |
Is it possible to solve this with this package? If not then what are the use-cases for this package( vue-client-only). |
@edugrip when ssr picks up the lib, even if you don't render due to client-only, the lib still has to make sense ssr-wise, hence @egoist's answer. What you can do is to either ask for SSR support or define an alias on your bundler that compiles your server-side component to nothing (kind of like Nuxt does with plugins and mode: server) |
@thiagobrandam , if the lib makes sense ssr-wise, why would it not render on ssr? Or is this library for those components who can be rendered on server but you do not want them to be rendered there ? |
Check the PR above for the fix :) |
Had this issue today because the https://forum.vuejs.org/t/defer-evaluation-of-conditionally-rendered-slots/32869/4 |
Hello, same probleme with Alex-D/Cookies-EU-banner . So if I understand, there no solutions ? |
There is, but I have to fix my PR, because there's error in it. |
despite using client only code the above error is generated.
For example using this
@johmun/vue-tags-input
repository.the reason is that when we import this in the component, this creates an error.
Template:
....
...
so how can we import the js with
window
anddocuemnt
variables without generating an error?[vue-router] Failed to resolve async component default: ReferenceError: window is not defined
[vue-router] uncaught error during route navigation:
ReferenceError: window is not defined
at Object. (/projects/test/hacker/node_modules/@johmun/vue-tags-input/dist/vue-tags-input.js:1:268)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at r (/projects/test/hacker/node_modules/vue-server-renderer/build.dev.js:9295:16)
at Object. (server-bundle.js:3772:18)
at webpack_require (server-bundle.js:27:30)
at Object.117 (4.server-bundle.js:24:81)
at webpack_require (server-bundle.js:27:30)
at Object.116 (4.server-bundle.js:8:191)
at webpack_require (server-bundle.js:27:30)
at Object.81 (4.server-bundle.js:836:96)
The text was updated successfully, but these errors were encountered: