Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
Translate faq/window-document-undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
rspt committed Apr 24, 2017
1 parent 9874ba7 commit e5ce926
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions fr/faq/window-document-undefined.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Window/Document undefined
description: Window/Document undefined avec Nuxt.js?
---

# Window/Document undefined?

Cette erreur est du au rendu côté serveur.
Si vous devez spécifier que vous souhaitez importer une ressource uniquement côté client, vous devez utiliser la variable `process.BROWSER_BUILD`.

Par exemple, dans votre fichier .vue:
```js
if (process.BROWSER_BUILD) {
require('external_library')
}
```

N'oubliez pas d'ajouter la librairie dans le [bundle vendor](/api/configuration-build#build-vendor) dans `nuxt.config.js`:
```js
build: {
vendor: ['external_library']
}
```

0 comments on commit e5ce926

Please sign in to comment.