[Vue warn]: Error in mounted hook: "Error: Container element not found"
See original GitHub issueHello,
I am using Wavesurfer 4.4.0
“wavesurfer.js”: “^4.4.0”
In vue, I am trying to use it as:
<div id="waveform" ref="waveform"></div>
import WaveSurfer from 'wavesurfer.js';
mounted() {
this.createWaveSurfer();
},
methods: {
createWaveSurfer() {
var wavesurfer = WaveSurfer.create({
container: #waveform,
waveColor: 'violet',
progressColor: 'purple'
});
wavesurfer.on('ready', function () {
wavesurfer.play();
});
wavesurfer.load(
"https://mywebsite.com/storage/text/1611243371.wav"
);
},
}
I keep receiving this error:
[Vue warn]: Error in mounted hook: “Error: Container element not found”
Any idea why please?
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8
Top Results From Across the Web
Vuejs Leaflet : Map Container Not Found - Stack Overflow
When you try instantiating your Leaflet Map by passing it your Element id ( L.map('mapid') ), the problem is that your Vue component...
Read more >Server-Side Rendering (SSR) - Vue.js
For browser-only APIs, the common approach is to lazily access them inside client-only lifecycle hooks such as mounted onMounted . Note that if...
Read more >FAQ - qiankun - UmiJS
Application died in status NOT_MOUNTED: Target container with #container not existed while xxx mounting! This error usually occurs when the main app is...
Read more >[Solved]-Vuejs Leaflet : Map Container Not Found-Vue.js
When you try instantiating your Leaflet Map by passing it your Element id ( L.map('mapid') ), the problem is that your Vue component...
Read more >Understanding refs in Vue - LogRocket Blog
Refs are Vue.js instance properties used to register a reference to HTML ... this means that Vue does not see this as an...
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
Please give me till the weekend, and I will recheck it on my local machine as I am away at the moment. I will keep you updated.
Thank you so much for your efforts 😃
Are you showing the full component? Are you using
v-if
somewhere to hide the<div>
?Refs should be available in the mounted hook, you can test this easily:
In my project I load WaveSufer the same way as you do and it works.