Vuepress: process is not defined when checking if I am in a browser environment

Created on 28 May 2019  ·  3Comments  ·  Source: vuejs/vuepress




  • [x] I confirm that this is an issue rather than a question.




Bug report

Steps to reproduce

Use a vue component that call process node variable:

created() {
console.log(process);
},

What is expected?

In vue project process variable should be accessible.

What is actually happening?

image

Other relevant information

I use process variable to know if I am in a broswer mode to load not ssr compatbile components vue-dropzone. code from here: https://github.com/Etheryte/nuxt-dropzone/blob/master/index.js

I use a workaround with lazy loading but just wanted to report it and understand if it's normal:
vueDropzone: () => import('vue2-dropzone'),


  • [x] My VuePress version is lower and euqal than 1.0.0-alpha.47:

    • VuePress version: 0.14.11
    • OS: Linux
    • Node.js version: 10.9.0
    • Browser version: latest chrome
    • Is this a global or local install? local
    • Which package manager did you use for the install? npm
    • Does this issue occur when all plugins are disabled? yes
  • [ ] My VuePress version is higher than 1.0.0-alpha.47, the following is the output of npx vuepress info in my VuePress project:

All 3 comments

process is Node-only variable. if you want to access it in client side code, you should use [define] to define it.

我也遇到同样的问题

我也遇到同样的问题

我这个还比较尴尬的是,我这个是npm包中使用到了process

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lesliecdubs picture lesliecdubs  ·  3Comments

sankincn picture sankincn  ·  3Comments

genedronek picture genedronek  ·  3Comments

cfjedimaster picture cfjedimaster  ·  3Comments

lileiseven picture lileiseven  ·  3Comments