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.

NotYetImplemented error in HTMLCanvasElement

See original GitHub issue

Getting an error with message “NotYetImplemented” from utils.js I get the error while using nodejs server, what this exact error means? When I’m using “ng serve” there is not such error.

I’m using line chart from ng2-charts module. Full Stack Trace:

ERROR Error: NotYetImplemented
    at HTMLCanvasElement.exports.nyi (/home/project15/web/node_modules/domino/lib/utils.js:41:9)
    at BaseChartDirective.ngOnInit (/home/project15/web/node_modules/ng2-charts/charts/charts.js:24:47)
    at checkAndUpdateDirectiveInline (/home/project15/web/node_modules/@angular/core/bundles/core.umd.js:12439:19)
    at checkAndUpdateNodeInline (/home/project15/web/node_modules/@angular/core/bundles/core.umd.js:13966:20)
    at checkAndUpdateNode (/home/project15/web/node_modules/@angular/core/bundles/core.umd.js:13909:16)
    at prodCheckAndUpdateNode (/home/project15/web/node_modules/@angular/core/bundles/core.umd.js:14633:5)
    at Object.updateDirectives (/home/project15/web/dist-server/main.bundle.js:1:51133)
    at Object.updateDirectives (/home/project15/web/node_modules/@angular/core/bundles/core.umd.js:14355:29)
    at checkAndUpdateView (/home/project15/web/node_modules/@angular/core/bundles/core.umd.js:13875:14)
    at callViewAction (/home/project15/web/node_modules/@angular/core/bundles/core.umd.js:14226:21)

Using the following: NodeJS: 9.3.0 Angular: 5.1.2 OS: linux x64 “chart.js”: “^2.7.1” “ng2-charts”: “^1.6.0”

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:11

github_iconTop GitHub Comments

1reaction
pedromcunhacommented, Sep 12, 2019

I’ve just gotten this with the lottie library. It’s happening right as soon as the module is initialized:

var ImagePreloader = (function(){

    var proxyImage = (function(){
        var canvas = createTag('canvas');
        canvas.width = 1;
        canvas.height = 1;
        var ctx = canvas.getContext('2d');
        ctx.fillStyle = 'rgba(0,0,0,0)';
        ctx.fillRect(0, 0, 1, 1);
        return canvas;
    }())

If it were in my application I would just wrap this in a conditional and only execute if inside the browser. But it seems to be too deep to reach. Anyone have any suggestions?

0reactions
inesDomicommented, Nov 15, 2021

For me, the above solution (@rtyx) doesn’t work, but if I replace this

<div style="display: block" *ngIf="isBrowser">
    <canvas baseChart
                    [datasets]="datasets"
                    [options]="barChartOptions"
                    [legend]="barChartLegend"
                    [chartType]="'bar'"
                    [colors]="statisticsService.colors"
                    (chartHover)="chartHovered($event)"
                    (chartClick)="chartClicked($event)">
    </canvas>
</div> 

by this, It’s works for me!

ngAfterViewInit(): void { if (this.isBrowser) { this.ctx = this.canvas.nativeElement.getContext( '2d', ) as CanvasRenderingContext2D; .... } }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Server side rendering error HTMLCanvasElement ...
Error : NotYetImplemented at HTMLCanvasElement.exports.nyi ... i am geeting this error angular 5 server side rendering.
Read more >
Notyetimplemented - Htmlcanvaselement.Wo4J.Exports.Nyi
Issue. I've got an angular 7.2 app using open layers 5.3. I'm trying to set up angular universal Error: NotYetImplemented at HTMLCanvasElement.
Read more >
angular/universal - Gitter
@rickvandermey I tried to set up your starterkit app. But the build is failing with an error. "An unhandled exception occurred: Project does...
Read more >
NotYetImplemented error in HTMLCanvasElement
Getting an error with message "NotYetImplemented" from utils.js. I get the error while using nodejs server, what this exact error means?
Read more >
HTMLCanvasElement - Web APIs | MDN
Chrome Edge HTMLCanvasElement Full support. Chrome1. Toggle history Full support. Edge1... captureStream Full support. Chrome51. Toggle history Full support. Edge7... contextlost event. Experimental Full support. Chrome98....
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