You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/08/02 15:27:39 UTC

[GitHub] damiangreen opened a new issue #8802: ReferenceError: document is not defined

damiangreen opened a new issue #8802: ReferenceError: document is not defined
URL: https://github.com/apache/incubator-echarts/issues/8802
 
 
   I'm using this lib in React Starter Kit which is ismorphic.
   I'm also using echarts-for-react
   and importing like this:
   ```
   const EchartsReact =
     typeof document !== 'undefined' && require('echarts-for-react').default; // eslint-disable-line
   ```
   
   The page can work on first load but refreshes cause it to blow up.
   Full stacktrace
   
   ```
   ReferenceError: document is not defined
   
     - env.js:129 detect
       [code]/[zrender]/lib/core/env.js:129:24
   
     - env.js:43 Object.<anonymous>
       [code]/[zrender]/lib/core/env.js:43:9
   
     - index.js:91 Module._compile
       [code]/[pirates]/lib/index.js:91:24
   
     - index.js:96 Object.newLoader [as .js]
       [code]/[pirates]/lib/index.js:96:7
   
     - module.js:11 require
       internal/module.js:11:18
   
     - zrender.js:3 Object.<anonymous>
       [code]/[zrender]/lib/zrender.js:3:11
   
     - index.js:91 Module._compile
       [code]/[pirates]/lib/index.js:91:24
   
     - index.js:96 Object.newLoader [as .js]
       [code]/[pirates]/lib/index.js:96:7
   
     - module.js:11 require
       internal/module.js:11:18
   
     - echarts.js:5 Object.<anonymous>
       [code]/[echarts]/lib/echarts.js:5:15
   
   
    * SET_RUNTIME_VARIABLE: { name: 'initialNow', value: 1533222581682 }
    * SET_RUNTIME_VARIABLE: { name: 'availableLocales', value: [ 'en-US', 'cs-CZ' ] }
    * SET_LOCALE_START: { locale: 'en-US' }
    * SET_LOCALE_SUCCESS: locale en-US: 9 messages
     TypeError: action.default is not a function
   
     - router.js:18
     code/src/router.js:18:1
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org