When running the API example: PCB Sales I get an error message: "Cannot read property 'emit' of undefined" - Please help.
S
Simon Garrison
started a topic
7 days ago
Thanks for submitting a support ticket and providing the sample screen capture. Here's a quick tutorial I created using the sample API example (Automated PCB Quotes).
Simon Garrison
Thanks for submitting a support ticket and providing the sample screen capture. Here's a quick tutorial I created using the sample API example (Automated PCB Quotes).
https://numericalsoftware-update.s3.us-east-1.amazonaws.com/2025-06-05_20-21-20-api-genquote.mp4
When performing a google search "Cannot read property 'emit' of undefined", here's the response
https://stackoverflow.com/questions/70328769/typeerror-cannot-read-properties-of-null-reading-emit
https://github.com/jsdom/jsdom/issues/1507
Commonly caused by wrong this. Add the arrow lambda syntax =>
private onStateChangeEvent = (event: any) => {
console.log("reached here: " + event);
this.myEmitter.emit(1); // now correct this
}
Note: The demo example is in plain HTML, so I believe the issue may be with the $emit... is related to your vue.js source code?
Thanks again, and please let me know your results.
Best regards,
Simon