Closed jujuna closed 4 months ago
Hello 👋 ,
Your error message is quite generic and does not provide the full details of the error.
Therefore, I cannot provide you with a precise solution. However, I believe that the error may be due to the fact that you need to start the services with await startServices(env);
before mounting the Owl app. You can refer to an example of how I did this in a standalone app at https://github.com/fdardenne/owlybook/blob/main/static/src/js/main.js.
PS: you don't need to call super.setup()
in the setup()
method. The Component
class does not implement any logic in this method.
I hope this helps!
hi @jujuna maybe the answer is ther https://github.com/odoo/owl/issues/1564
@jujuna which Odoo version are you working with ? I personnaly struggling on v16 https://github.com/odoo/odoo/issues/151490
@fdardenne Hello, your link doesn't work
@flotho I am working on 17 version, I will see your link if it helps me, thank you!
@flotho @fdardenne
This is my main.js
file
/** @odoo-module **/
import { mount, whenReady } from "@odoo/owl";
import { WebClient } from "./webclient/web_client";
import { templates } from "@web/core/assets";
// Mount the WebClient component when the document.body is ready
whenReady(() => {
mount(WebClient, document.body, {
templates,
dev: true,
name: "Library",
});
});
as recommended for v17, use mountcomponent instead, it will work easier
Hi @fdardenne does the code you shared woks with services ?
Hi @fdardenne does the code you shared woks with services ?
Hello, yes it should
I meant does your code effectively worked or did you expect it to work ?
@flotho Thank you! I used mountComponent
and it works.
is it a standalone component ?
@flotho Yes
perfect, everything is clear. MAybe this issue could be closed ?
I am making web client from zero through tutorial of OXP but I have this error when I use
useService
Uncaught (in promise) Error: An error occured in the owl lifecycle (see this Error's "cause" property)this is my assets code
and small js code