TypeError: Cannot read property 'replace' of undefined
See original GitHub issueGet 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:
- Created 3 years ago
- Reactions:2
- Comments:11 (5 by maintainers)
Top 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 >
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 Free
Top 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
@lmiller1990 it works now! ✅
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).