question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'initialize' of undefined

See original GitHub issue

Hello! I’m experiencing the following issue:

(etf) rhuemmer@PCAED685:~/etf$ ./node_modules/.bin/mmdc -i ./doc/sphinx/source/hardware/linux/tcp_client.mmd -o test.png -p ./doc/sphinx/source/puppeteer-config.json 
/home/rhuemmer/etf/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217
            throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
                  ^

Error: Evaluation failed: TypeError: Cannot read property 'initialize' of undefined
    at __puppeteer_evaluation_script__:3:20
    at ExecutionContext._evaluateInternal (/home/rhuemmer/etf/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:217:19)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async ExecutionContext.evaluate (/home/rhuemmer/etf/node_modules/puppeteer/lib/cjs/puppeteer/common/ExecutionContext.js:106:16)
    at async ElementHandle.evaluate (/home/rhuemmer/etf/node_modules/puppeteer/lib/cjs/puppeteer/common/JSHandle.js:102:16)
    at async ElementHandle.$eval (/home/rhuemmer/etf/node_modules/puppeteer/lib/cjs/puppeteer/common/JSHandle.js:650:24)
(etf) rhuemmer@PCAED685:~/etf$

Puppeteer und mermaid.cli are the latest version:

(etf) rhuemmer@PCAED685:~/etf$ npm list --depth=1
etf@ /home/rhuemmer/etf
β”œβ”€β”¬ @mermaid-js/mermaid-cli@8.8.2-beta.8
β”‚ β”œβ”€β”€ chalk@4.1.0
β”‚ β”œβ”€β”€ commander@6.2.0
β”‚ └── puppeteer@5.4.1
β”œβ”€β”¬ bufferutil@4.0.2
β”‚ └── node-gyp-build@4.2.3
β”œβ”€β”¬ chromium@3.0.2
β”‚ β”œβ”€β”€ cachedir@2.3.0
β”‚ β”œβ”€β”€ debug@4.2.0
β”‚ β”œβ”€β”€ extract-zip@1.7.0
β”‚ β”œβ”€β”€ got@11.8.0
β”‚ β”œβ”€β”€ progress@2.0.3
β”‚ β”œβ”€β”€ rimraf@2.7.1
β”‚ β”œβ”€β”€ tmp@0.0.33
β”‚ └── tunnel@0.0.6
└─┬ utf-8-validate@5.0.3
  └── node-gyp-build@4.2.3 deduped

Version of node and nodejs:

(etf) rhuemmer@PCAED685:~/etf$ nodejs -v
v8.10.0
(etf) rhuemmer@PCAED685:~/etf$ node -v
v15.0.1

This issue is related to: https://github.com/mermaid-js/mermaid/issues/662 I also already asked at https://github.com/mermaid-js/mermaid-cli/issues/70, but it turned out that mermaid-cli is just a thin-layer and I should address my question to the mermaid library. What could be the problem? Is this a bug or some configuration problem on my side?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
kolodachcommented, May 17, 2022

Run into the same issue recently. As a temporary solution, you can adjust your puppeteer json file with these arguments:

{
  "args": [
            "--disable-gpu",
            "--disable-dev-shm-usage",
            "--disable-setuid-sandbox",
            "--no-first-run",
            "--no-sandbox",
            "--no-zygote",
            "--single-process"]
}

Tested on WSL2 Ubuntu 20.04 - fixed issue for me. Original solution: https://github.com/puppeteer/puppeteer/issues/1837#issuecomment-534075536

0reactions
korompaiistvancommented, Aug 5, 2021

just ran into this myself. my diagram is fairly long. should I post it here nonetheless?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'initialize' of ...
Currently I am working on an Upgradation project; I am facing the Below Exception when I instantiate the Custom Router Class from the...
Read more >
[Tutorial] Cannot read property 'initialize' of undefined #698
I import this into App.js with import {HomeeDb} from './services/Database'; Then call it with const db = HomeeDb(); . The app crashes whenΒ ......
Read more >
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >
Uncaught TypeError: Cannot read property ... - SAP Community
Hi, I have developed UI5 application and deployed into ABAP server. When I try to run on ABAP server from Eclipse it is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found