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.

"TypeError: Reflect.getPrototypeOf called on non-object" with local plugins

See original GitHub issue

Hi,

I’m getting an error during the registration of this plugin with chart.js 3.4.1 and vue 2.6:

TypeError: Reflect.getPrototypeOf called on non-object

For the registration of the plugin I followed the doc here

You can replicate the issue with this sandbox

I’ve opened the issue here because I think that it depends on this plugin (but I’m not sure, correct me if I’im wrong) as If you comment line 9 and line 28 the error does not seems to appear

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
kurklecommented, Jul 6, 2021

Making the chart non-reactive resolves the problem: https://codesandbox.io/s/headless-wave-p8jpi?file=/src/App.vue

0reactions
etimbergcommented, Jul 17, 2021

I did some digging. This is appears to be due to how Vue observes the chart object. I suspect this would occur with plugins registered globally as well. The error occurs when Vue is trying to observe Chart._plugins._init[6].options. The plugin has no scopes, and as a result this code calls Reflect.getPrototypeOf(undefined). A simple solution here might be to guard the scope passed in as const scope = scopes[0] || {} to ensure that no falsy values get passed.

getPrototypeOf() {
  return Reflect.getPrototypeOf(scopes[0]);
},
Read more comments on GitHub >

github_iconTop Results From Across the Web

Reflect.getPrototypeOf called on non-object" with local plugins
Hi,. I'm getting an error during the registration of this plugin with chart.js 3.4.1 and vue 2.6: TypeError: Reflect.getPrototypeOf called ...
Read more >
javascript - Node.js - Object.getPrototypeOf - Stack Overflow
I want to be to able to set and get the prototype of a string. The one weird thing is that I can...
Read more >
Expert JavaScript - Akkurt
TypeError: object is not a function. Math();. Where possible, it is best to return a similar result from a constructor regardless of whether...
Read more >
react-formik-ui - UNPKG
propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with ...
Read more >
Converse.js API Documentation Source: headless/dist ...
function btoa(s) { if (arguments.length === 0) { throw new TypeError("1 ... valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } ...
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