Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not implemented: HTMLCanvasElement.prototype.getContext error logged in jsdom #646

Open
srmagura opened this issue Jul 20, 2022 · 2 comments

Comments

@srmagura
Copy link

This error will occur if init is called in jsdom / Jest.

Error: Not implemented: HTMLCanvasElement.prototype.getContext (without installing the canvas npm package)
          at module.exports (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
          at HTMLCanvasElementImpl.getContext (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js:42:5)
          at HTMLCanvasElement.getContext (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js:131:58)
          at /Users/srmagura/Documents/oss/emoji-mart/node_modules/is-emoji-supported/src/is-emoji-supported.ts:47:44
          at Object.<anonymous> (/Users/srmagura/Documents/oss/emoji-mart/node_modules/is-emoji-supported/src/is-emoji-supported.ts:107:2)
          at Runtime._execModule (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jest-runtime/build/index.js:1691:24)
          at Runtime._loadModule (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jest-runtime/build/index.js:1222:12)
          at Runtime.requireModule (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jest-runtime/build/index.js:1046:12)
          at Runtime.requireModuleOrMock (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jest-runtime/build/index.js:1247:21)
          at Runtime.loadCjsAsEsm (/Users/srmagura/Documents/oss/emoji-mart/node_modules/jest-runtime/build/index.js:853:22) {
        type: 'not implemented'
      }

I've created a PR to is-emoji-supported that fixes it: koala-interactive/is-emoji-supported#21

@ninoman
Copy link

ninoman commented Jul 25, 2022

@EtienneLem I saw you closed the PR, but I still have this error in my application console while running the tests, do we still wait for the fixes to be deployed to the new version?

@srmagura
Copy link
Author

@ninoman I think you may be mistaken — PR #642 was for a different issue. The PR for this error is still open: koala-interactive/is-emoji-supported#21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants