Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Uncaught Odoo errors

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
settingsuncaughterrorsundefinedodoo
1 Răspunde
3118 Vizualizări
Imagine profil
shraddha

In few product pages I am getting this error
UncaughtPromiseError > TypeError

Uncaught Promise > Cannot read properties of null (reading 'querySelectorAll')

TypeError: Cannot read properties of null (reading 'querySelectorAll')

    at Class.start (https://shop.testogcc.ae/web/assets/1/58ebb3c/web.assets_frontend_lazy.min.js:10652:2313)

    at prototype.<computed> [as start] (https://shop.testogcc.ae/web/assets/1/58ebb3c/web.assets_frontend_lazy.min.js:3372:516)

    at https://shop.testogcc.ae/web/assets/1/58ebb3c/web.assets_frontend_lazy.min.js:6166:13

    at async Promise.all (index 0)

    at async Promise.all (index 95)

    at async Promise.all (index 1)
And the JS is of 10K+ lines Can't understand how to fix it

0
Imagine profil
Abandonează
Mauricio Alejandro Gonzalez

maybe are you creating a new view or template in Odoo?

If you are, can you share the code with us, it will be useful for more context.

Imagine profil
Gracious Joseph
Cel mai bun răspuns

The error "Cannot read properties of null (reading 'querySelectorAll')" typically occurs when JavaScript is attempting to select an element on the page using querySelectorAll, but the element does not exist in the DOM at the time the code runs. This issue is common in dynamically rendered pages like Odoo's frontend.

Here's how to troubleshoot and resolve this issue:

1. Understand the Error

  • The error indicates that querySelectorAll is being called on null, meaning the parent element or DOM element being queried is not present when the script runs.
  • Likely causes:
    • Missing or improperly loaded HTML elements.
    • JavaScript code executing before the DOM is fully rendered.
    • A condition in the template or JS code that fails to include the required element.

2. Identify the Source of the Problem

To pinpoint the issue, follow these steps:

a. Check the Line of Failure

  • The error occurs in:
    at Class.start (web.assets_frontend_lazy.min.js:10652:2313)
    
  • The start method is likely in a widget or class responsible for handling a frontend feature.

b. Unminify the Code

  • If possible, replace the minified web.assets_frontend_lazy.min.js with the original (unminified) JS file for debugging. Alternatively, use browser developer tools' "Pretty Print" feature to format the code.

c. Reproduce the Error

  • Open the product page where the error occurs.
  • Inspect the console to confirm the line and the conditions under which the error is thrown.

d. Look for the Selector

  • The issue may involve a specific widget or feature using a query like:
    const elements = this.$el[0].querySelectorAll('.some-class');
    
  • Check the .some-class in the page source to see if it exists.

3. Debugging the Issue

a. Validate the HTML Structure

  • Use browser developer tools (F12 in most browsers) to inspect the product page.
  • Ensure all required elements exist in the DOM before the script runs.
  • Look for:
    • Missing elements (e.g., .some-class).
    • Improperly loaded assets.

b. Check for Dynamic Rendering

  • If the page relies on AJAX or lazy loading, the script might run before the elements are available.
  • Wrap the script inside a DOMContentLoaded or equivalent callback to ensure it executes after the DOM is ready:
    document.addEventListener('DOMContentLoaded', function () {
        const elements = document.querySelectorAll('.some-class');
        if (elements) {
            // Your logic here
        }
    });
    

c. Handle Null Checks

  • Add checks in the JavaScript code to ensure the element exists before calling querySelectorAll:
    const parentElement = document.querySelector('.parent-class');
    if (parentElement) {
        const elements = parentElement.querySelectorAll('.some-class');
        // Further processing
    }
    

4. Fixing the Root Cause

a. Verify the Template

  • If the error occurs in a specific Odoo template, ensure the required elements are present in the QWeb template.
  • Example:
    <div class="parent-class">
        <div class="some-class">Content</div>
    </div>
    
  • Missing or conditionally excluded elements can cause this error.

b. Customize the Widget

  • If the issue is in an Odoo widget (e.g., in start()), override the widget to include a null check.
    Example:
    const MyWidget = Widget.extend({
        start: async function () {
            const parentElement = this.$el[0];
            if (parentElement) {
                const elements = parentElement.querySelectorAll('.some-class');
                // Your logic
            }
            return this._super(...arguments);
        },
    });
    

c. Update Odoo or Assets

  • If this is caused by a bug in Odoo's assets:
    • Update to the latest Odoo version to include any patches or fixes.
    • Rebuild the assets:
      ./odoo-bin -c odoo.conf --dev=assets
      

5. Advanced Debugging

a. Use Breakpoints

  • Set a breakpoint at the erroring line using browser developer tools.
  • Inspect the variables and DOM state at runtime to understand why the element is missing.

b. Disable Third-Party Modules

  • Temporarily disable custom or third-party modules that may modify product pages.
  • Test if the error persists with only Odoo's default configuration.

c. Rebuild Assets

  • Clear and regenerate frontend assets:
    ./odoo-bin -u all --dev=assets
    

6. Summary

  • This error is typically caused by missing elements or timing issues.
  • To resolve:
    1. Verify the DOM structure and ensure elements exist.
    2. Add null checks or delay the script execution until the DOM is ready.
    3. Customize the widget or template if needed.
    4. Update Odoo and rebuild assets to ensure you're using the latest fixes.

If the issue persists, provide additional details about the specific code or template causing the problem for more targeted assistance.

0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
i see this Error:Uncaught Promise > Cannot read properties of undefined (reading 'Symbol(html)')
settings docs uncaught undefined v15
Imagine profil
Imagine profil
1
ian. 23
27153
I cannot access to setting due to an error " Cannot read properties of undefined (reading 'string')"
settings errors
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
mar. 23
8614
How to add new value in Selection in Settings Rezolvat
settings selection odoo
Imagine profil
Imagine profil
1
mai 21
4638
Admin rights not working
settings users administration odoo
Imagine profil
Imagine profil
1
feb. 24
3095
How to disable export for no admin users in Odoo Studio?
settings export odoo Studio
Imagine profil
0
iun. 23
2603
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now