You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/07/06 07:38:32 UTC

[GitHub] [incubator-echarts] luisenriqueramos1977 opened a new issue #12916: Cannot read property 'getElementById' of undefined

luisenriqueramos1977 opened a new issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916


   ### Version
   4.8.0
   
   ### Steps to reproduce
   1. edit index.js
   2. paste example 1 from https://echarts.apache.org/en/tutorial.html#ECharts%20Basic%20Concepts%20Overview
   3. Error
   
   ### What is expected?
   a graph according to example
   
   ### What is actually happening?
   var myChart = echarts.init(document.getElementById('main'));
                              ^
   
   ReferenceError: document is not defined
       at Object.<anonymous> (/home/lsrs/Desktop/jsexercise/egraphtest/index.js:6:28)
       at Module._compile (internal/modules/cjs/loader.js:778:30)
       at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
       at Module.load (internal/modules/cjs/loader.js:653:32)
       at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
       at Function.Module._load (internal/modules/cjs/loader.js:585:3)
       at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
       at startup (internal/bootstrap/node.js:283:19)
       at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
   
   [Done] exited with code=1 in 0.699 seconds
   
   ---
   I  included the code: 
   
   var document = document.getElementById('dom-id');
   
   and appeared the new error:
   
   var document = document.getElementById('dom-id');
                           ^
   
   TypeError: Cannot read property 'getElementById' of undefined
       at Object.<anonymous> (/home/lsrs/Desktop/jsexercise/egraphtest/index.js:2:25)
       at Module._compile (internal/modules/cjs/loader.js:778:30)
       at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
       at Module.load (internal/modules/cjs/loader.js:653:32)
       at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
       at Function.Module._load (internal/modules/cjs/loader.js:585:3)
       at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
       at startup (internal/bootstrap/node.js:283:19)
       at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654093292


   I think there may be missing some detailed information.
   1) What does your source code like?
   2) Are there some grammar or usage errors in your source code?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] echarts-bot[bot] commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654069502


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that **you have posted enough image to demo your request**. You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical questions.
   
   If you are interested in the project, you may also subscribe our [mail list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654099640


   This code looks like no problem. I'm afraid this error is related to the environment of your project, please ensure whether `document` or `window` exists and is able to be fetched.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart closed issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
plainheart closed issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] luisenriqueramos1977 commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
luisenriqueramos1977 commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654095326


   Dear Wang,
   
   thanks for your quick response, the code I using is exactly the one it is
   published in this source
   
   https://echarts.apache.org/en/tutorial.html#Use%20ECharts%20with%20webpack
   
   this is the code:
   
   var echarts = require('echarts'); // initialize echarts instance with
   prepared DOM var myChart = echarts.init(document.getElementById('main')); //
   draw chart myChart.setOption({ title: { text: 'ECharts entry example' },
   tooltip: {}, xAxis: { data: ['shirt', 'cardign', 'chiffon shirt', 'pants',
   'heels', 'socks'] }, yAxis: {}, series: [{ name: 'sales', type: 'bar', data:
   [5, 20, 36, 10, 10, 20] }] });
   
   
   Until now, I have not been able to run any example, all generate errors.
   
   
   Luis Ramos
   
   
   
   
   El lun., 6 jul. 2020 a las 10:29, Zhongxiang.Wang (<no...@github.com>)
   escribió:
   
   > I think there may be missing some detailed information.
   >
   >    1. What does your source code like?
   >    2. Are there some grammar or usage errors in your source code?
   >
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654093292>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/ALS7GAHAY72JQBIPQZL4KT3R2GDNPANCNFSM4ORKSKWQ>
   > .
   >
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] luisenriqueramos1977 commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
luisenriqueramos1977 commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654106250


   The only thing I did was install according instructions
   npm install echarts --save, in vs code. 
   
   many erros for missing package were produced, but I only had to install packages, and finally run with errors. I attached the view of my environment
   
   ![image](https://user-images.githubusercontent.com/48624384/86575271-481b8d00-bf77-11ea-9e77-938316e1f635.png)
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654119041


   I'm still confused about this, but anyway, I'm glad it works for you now.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] luisenriqueramos1977 commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
luisenriqueramos1977 commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654102770


   I think I included document as follows:
   var document = document.getElementById('dom-id');
   
   and later got this error:
   
   var myChart = echarts.init(document.getElementById('main'));
                                       ^
   
   TypeError: Cannot read property 'getElementById' of undefined
       at Object.<anonymous> (/home/lsrs/Desktop/jsexercise/egraphtest/index.js:6:37)
       at Module._compile (internal/modules/cjs/loader.js:778:30)
       at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
       at Module.load (internal/modules/cjs/loader.js:653:32)
       at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
       at Function.Module._load (internal/modules/cjs/loader.js:585:3)
       at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
       at startup (internal/bootstrap/node.js:283:19)
       at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
   
   [Done] exited with code=1 in 0.693 seconds
   
   
   Until now, I have not been able to run any example, and I feel frustrated.
   
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] luisenriqueramos1977 commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
luisenriqueramos1977 commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654116970


   okay,
   
   I finally got one working,
   
   https://echarts.apache.org/en/tutorial.html#Create%20Custom%20Build%20of%20ECharts
   
   I have to remark, that I changed the code for this:
   
   *<script src="lib/echarts.custom.js"></script> *
   
   to this
   
   <script src="lib/echarts.custom.min.js"></script>
   
   
   It was open with live server in vs code
   
   
   I will continue with other exercises
   
   
   Luis
   
   
   
   
   
   
   
   
   
   
   
   El lun., 6 jul. 2020 a las 11:04, Zhongxiang.Wang (<no...@github.com>)
   escribió:
   
   > It needs a HTML but not just run index.js, document can't be fetched in
   > node env.
   >
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654110137>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/ALS7GAFZ2PEXSGCYF657LD3R2GHQ3ANCNFSM4ORKSKWQ>
   > .
   >
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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


[GitHub] [incubator-echarts] plainheart commented on issue #12916: Cannot read property 'getElementById' of undefined

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #12916:
URL: https://github.com/apache/incubator-echarts/issues/12916#issuecomment-654110137


   It needs a HTML but not just run `index.js`, `document` can't be fetched in node env.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



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