Hello,
We get the following error on many of our owl components when trying to migrate from version 16 to 18.
Uncaught Error: Error while loading "@voice_generation/js/audio_player":
Error: Invalid object: unknown key 'template', 'component' is missing
startModule http://127.0.0.1:18069/web/assets/1dca19f/web.assets_web.min.js:17
startModules http://127.0.0.1:18069/web/assets/1dca19f/web.assets_web.min.js:16
addJob http://127.0.0.1:18069/web/assets/1dca19f/web.assets_web.min.js:13
define http://127.0.0.1:18069/web/assets/1dca19f/web.assets_web.min.js:12
<anonymous> http://127.0.0.1:18069/web/assets/1dca19f/web.assets_web.min.js:23102
This is just a small widget component but we also get similar issues on other components
Here's the code:
/** @odoo-module **/
import {xml, Component, useState} from "@odoo/owl";
import {registry} from "@web/core/registry";
export class AudioPlayer extends Component {
setup() {
console.log(this.props);
this.state = useState({url: "/api/voice/play/" + this.props.record.data.id});
}
}
AudioPlayer.template = xml`<audio controls="controls" t-att-src="state.url">
Your browser does not support the audio element.
</audio>`;
registry.category("fields").add("AudioPlayer", AudioPlayer);
and we call it using
<field name="text" widget="voice_generation.AudioPlayer"/>
Any help is apreciated