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: Cannot read property 'replace' of undefined

See original GitHub issue

Get the following error in the render function when testing a component with a slot that renders another component:

TypeError: Cannot read property 'replace' of undefined

it('tests', () => {
  const wrapper = mount(ComponentX, {
    props: {
      label: 'Label',
    },
    slots: {
      default: h(ComponentY, { value: 'check' }),
    },
  })
})

The odd part is that it works in isolation, i.e., if we only run this test, but it doesn’t work when we run all tests.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
herkulanocommented, Dec 28, 2020

@lmiller1990 it works now! ✅

1reaction
lmiller1990commented, Dec 28, 2020

I just ran the reproduction provided and everything is passing. Maybe this got fixed already? @herkulano can you confirm if you are still having this problem?

I will close this for now since as far as I can tell this is no longer a bug (all ✅ for me).

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] Cannot Read Property 'replace' of Undefined in JS
To fix the “cannot read property 'replace' of undefined” error, perform an undefined check on the variable before calling the replace() method ......
Read more >
Cannot read property 'replace' of Undefined in JS - Isotropic
Cannot read property 'replace' of Undefined in JS ... method such as TypeError: Cannot read properties of undefined (reading 'replace') .
Read more >
cannot read property 'replace' of undefined In Grid - Stack ...
I think jQuery cannot find the element. First of all find the element var rowTemplate= document.getElementsByName("rowTemplate");.
Read more >
TypeError: Cannot read property 'replace' of undefined
So I tried to learn how to do this on my own by taking two video courses about node and cheerio on udemy...
Read more >
Error: Cannot read property 'replace' of undefined #649 - GitHub
Actual behaviour error Error: Evaluation failed: TypeError: Cannot read property 'replace' of undefined at Object.processFormControls...
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