Skip to Content
Menu
This question has been flagged
3 Replies
1949 Views

Odoo18, ubuntu 24
Follow the chapter 1 Owl components.
I got this error : A css error occured, using an old style to render this page in the page
and these errors in the console : 
OwlError@http://marinos:8069/web/assets/c9b3954/awesome_owl.assets_playground.min.js:715:1
Uncaught (in promise) Error: Missing template: "awesome_owl.playground" (for component "Playground")

tutorials folder is in the root folder next to odoo-bin

and it is set in odoo.conf file : 

[options]
addons_path = /home/alchemycode/Desktop/Alchemy/odoo/odoo18/odoo/addons,
/home/alchemycode/Desktop/Alchemy/odoo/odoo18/odoo/custom_addons,
/home/alchemycode/Desktop/Alchemy/odoo/odoo18/tutorials
db_host = localhost
db_port = 5432
db_user = odoo_alchemy
db_password = odoo_alchemy
default_productivity_apps = True
admin_passwd = $pbkdf2-sha512$600000$EIIwxvhfy7lXCmFMSclZaw$sDHADZ64zMqevCyyinBgu5zQdF41vD6r9OA3zHYWeUKRW8KjVGQT2p.wZs6XRymg1YYz85GIm6t0m.PjvsEzVQ

Any help for this problem 
i did not anything just follow the first step which is install awesome_owl module and visit localhost:8069/awesome_owl
Thanks in advance

Avatar
Discard
Author Best Answer

@Nikhil Nakrani
Thanks for answering.
But i used the same awesome_owl repo 18.0.
And still get these errors
----------------------------------------------------
Ok i found a solution : 
for the old style error : A css error occured, using an old style to render this page in the page
(1) In the manifest file : 

change this : 

'assets': {
'awesome_owl.assets_playground': [
# bootstrap
('include', 'web._assets_helpers'), #let
'web/static/src/scss/pre_variables.scss', #let
'web/static/lib/bootstrap/scss/_variables.scss',#let
('include', 'web._assets_bootstrap_backend'),# get rid of

# required for fa icons
'web/static/src/libs/fontawesome/css/font-awesome.css', # let

# include base files from framework
('include', 'web._assets_core'),# let

'web/static/src/core/utils/functions.js',# get rid of
'web/static/src/core/browser/browser.js',# get rid of
'web/static/src/core/registry.js',# get rid of
'web/static/src/core/assets.js',# get rid of
'awesome_owl/static/src/**/*', # let
],
},

To this : 

'assets': {
'awesome_owl.assets_playground': [
('include', 'web._assets_helpers'),
'web/static/src/scss/pre_variables.scss',
'web/static/lib/bootstrap/scss/_variables.scss',
'web/static/lib/bootstrap/scss/_maps.scss', # add this
('include', 'web._assets_bootstrap'),# add this
('include', 'web._assets_core'),# add this
'web/static/src/libs/fontawesome/css/font-awesome.css',
'awesome_owl/static/src/**/*',
],
},

And in main js file : (The problem of not displaying hello world)
change this : 

import { browser } from "@web/core/browser/browser";
import { mount, whenReady } from "@odoo/owl";
import { Playground } from "./playground";
import { templates } from "@web/core/assets";

// Mount the Playground component when the document.body is ready
whenReady( () => {
mount(Playground, document.body, { templates, dev: true, name: "Owl Tutorial" });
});

To this : 

import { browser } from "@web/core/browser/browser";
import { mount, whenReady } from "@odoo/owl";
import { mountComponent } from "@web/env";

import { Playground } from "./playground";
import { templates } from "@web/core/assets";

// Mount the Playground component when the document.body is ready
whenReady( () => {
mountComponent(Playground, document.body, { templates, dev: true, name: "Owl Tutorial" });
});

PS: use mountComponent from @web/env instead of mount.
PS: @Nikhil Nakrani owl="1" didn't work
It worked for me This way

Avatar
Discard

Hi,
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_owl.playground">
<div class="p-3">
hello world
</div>
</t>

</templates>

// try this way here

<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_owl.playground" owl="1">
<div class="p-3">
hello world
</div>
</t>

</templates>

template the owl="1" attribute in the definition.

Best Answer

I have the same problem, I just clone the repo and run the module, then I get "Uncaught Error (in promise): Missing template: "awesome_owl.playground" (for component "Playground")" in the browser, I use Debian 12 and Mozilla Firefox and Chrome

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 25
307
0
May 25
102
1
May 25
633
1
Apr 25
499
0
Mar 25
414