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.

Nuxt-edge Object(...)() is null / context is null

See original GitHub issue

Confirmation

  • I can confirm this problem is not reproducible with ECharts itself.

How are you introducing Vue-ECharts into your project?

ES Module imports

Versions

echarts@5.3.3
vue@2.7.8
vue-echarts@6.2.3
nuxt-edge@2.16.0-27616340.013f051b

Details

I have a project with vue-echart and nuxt 2 (version 2.15). I try to start migration to nuxt 3. First steps is to upgrade nuxt to nuxt-edge. It requires to remove @nuxtjs/composition-api cause Nuxt 2.16 is based on Vue 2.7. At this step I expect that all will run fine. Cause Vue 2.7 supports composition API. But it not.

Here is my browser console output: изображение

There are serveral warnings: [Vue warn]: inject() can only be used inside setup() or functional components. [Vue warn]: globally imported h() can only be invoked when there is an active component instance, e.g. synchronously in a component's render or setup function. [Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side render.

And two errors: TypeError: Object(...)() is null and TypeError: context is null

Reproduction

https://github.com/niklv/nuxt_echarts_bug

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Justineocommented, Aug 11, 2022

Try add this to nuxt.config.js as a workaround:

{
  alias: {
    vue: 'vue/dist/vue.runtime.esm.js'
  }
}
0reactions
Justineocommented, Aug 12, 2022

Not sure there’s anything can be done on our side. It seems that with Nuxt’s webpack config, the imported vue from vue-demi refers to the cjs version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - My Context Throw Error 'Object(...)(...)' as it is null
@aaliakinci I suspect it is something to do with order in which React DOMTrees are rendered, where a component's sub-tree is fully rendered ......
Read more >
How to Fix TypeError: Null is Not an Object in JavaScript
The JavaScript error TypeError: null is not an object occurs when a property is accessed or a method is called on a null...
Read more >
TypeError: cannot use 'in' operator to search for 'x' in 'y'
It can only be used to check if a property is in an object. ... Make sure the object you are inspecting isn't...
Read more >
TypeError: null or undefined has no properties - Airbrake Blog
The Null or Undefined Has No Properties error occurs specifically when attempting to call a property of the null object or undefined type....
Read more >
TypeError: null is not an object (evaluating 'H.scale ... - GitHub
TypeError: null is not an object (evaluating 'H.scale') error is thrown. variable H based on stacktrace seems to be context, likely changed ...
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