From 4163bb8d048f4218df75fec95d92df9021a53811 Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Sat, 11 Mar 2023 22:26:50 +0100 Subject: [PATCH] docs: warn about modules with side-effects (#19592) --- docs/2.guide/1.concepts/3.rendering.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/2.guide/1.concepts/3.rendering.md b/docs/2.guide/1.concepts/3.rendering.md index e5a843e8e347..b4093bd396bd 100644 --- a/docs/2.guide/1.concepts/3.rendering.md +++ b/docs/2.guide/1.concepts/3.rendering.md @@ -57,6 +57,10 @@ Universal rendering allows a Nuxt application to provide quick page load times w For more examples about writing Vue code without hydration mismatch, see [the Vue docs](https://vuejs.org/guide/scaling-up/ssr.html#hydration-mismatch). :: +::alert{type=warning} +When importing a library that relies on browser APIs and has side effects, make sure the component importing it is only called client-side. Bundlers do not treeshake imports of modules containing side effects. +:: + ### Examples Universal rendering is very versatile and can fit almost any use case, and is especially appropriate for any content-oriented websites: **blogs, marketing websites, portfolios, e-commerce sites, and marketplaces.**