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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
