"TypeError: Reflect.getPrototypeOf called on non-object" with local plugins
See original GitHub issueHi,
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:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Making the chart non-reactive resolves the problem: https://codesandbox.io/s/headless-wave-p8jpi?file=/src/App.vue
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 observeChart._plugins._init[6].options
. The plugin has no scopes, and as a result this code callsReflect.getPrototypeOf(undefined)
. A simple solution here might be to guard the scope passed in asconst scope = scopes[0] || {}
to ensure that no falsy values get passed.