Перейти к содержимому
Odoo Меню
  • Войти
  • Попробовать бесплатно
  • Модули
    Финансы
    • Бухгалтерия
    • Выставление счетов
    • Расходы
    • Таблицы
    • Документооборот
    • Подпись
    Продажи
    • CRM
    • Продажи
    • POS Магазин
    • POS Ресторан
    • Подписки
    • Аренда
    Вебсайты
    • Конструктор вебсайтов
    • eCommerce
    • Блог
    • Форум
    • Онлайн-чат
    • Электронное обучение
    Логистика
    • Склад
    • Производство
    • PLM
    • Закупки
    • Обслуживание
    • Качество
    Отдел кадров
    • Сотрудники
    • Подбор персонала
    • Отпуска
    • Оценка персонала
    • Реферальная программа
    • Автопарк
    Маркетинг
    • SMM
    • E-mail рассылки
    • СМС рассылки
    • Мероприятия
    • Автоматизация маркетинга
    • Опросы
    Услуги
    • Проекты
    • Табели
    • Выездной сервис
    • Поддержка
    • Планирование
    • Встречи
    Продуктивность
    • Обсуждения
    • Согласование
    • IoT
    • VoIP-телефония
    • Knowledge
    • WhatsApp
    Сторонние приложения Модуль Студия Odoo Платформа Odoo Cloud
  • Индустрии
    Розничная торговля
    • Книжный магазин
    • Магазин одежды
    • Мебельный магазин
    • Продуктовый магазин
    • Строительный магазин
    • Магазин игрушек
    Гостинично-ресторанный бизнес
    • Бар и паб
    • Ресторан
    • Фастфуд
    • Гостевой дом
    • Дистрибьютор напитков
    • Отель
    Недвижимость
    • Агентство недвижимости
    • Архитектурное бюро
    • Строительство
    • Управление недвижимостью
    • Ландшафтный дизайн
    • Товарищество собственников жилья
    Консалтинг
    • Бухгалтерская фирма
    • Партнер Odoo
    • Маркетинговое агентство
    • Юридическая фирма
    • Подбор персонала
    • Аудиторское бюро
    Производство
    • Текстиль
    • Металл
    • Мебель
    • Продукты питания
    • Пивоварня
    • Корпоративные сувениры
    Здоровье и фитнес
    • Спортивный комплекс
    • Магазин оптики
    • Фитнес-клуб
    • Велнес-центр
    • Аптека
    • Салон красоты
    Услуги
    • Специалист по бытовым услугам
    • Продажа и обслуживание IT-оборудования
    • Солнечные энергосистемы
    • Производство обуви
    • Клининг
    • Системы ОВКВ
    Прочее
    • Некоммерческая организация
    • Консалтинг в сфере устойчивого развития
    • Аренда рекламных щитов
    • Бизнес по фотосъемке
    • Прокат велосипедов
    • Реселлер программного обеспечения
    Все индустрии
  • Community
    Обучение
    • Видео уроки
    • Документация
    • Сертификация
    • Тренинг
    • Блог
    • Подкаст
    Образование и развитие
    • Образовательная программа
    • Деловая игра Scale Up!
    • Экскурсия в офис Odoo
    ПО
    • Скачать
    • Сравнить версии
    • Релизы
    Сотрудничество
    • Github
    • Форум
    • Мероприятия
    • Перевод
    • Стать партнером
    • Услуги для партнеров
    • Зарегистрировать бухгалтерскую фирму
    Услуги
    • Найти партнера
    • Найти бухгалтера
    • Встреча с экспертом
    • Услуги по внедрению
    • Отзывы клиентов
    • Поддержка
    • Обновления
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Заказать демонстрацию
  • Цены
  • Поддержка

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

  • CRM
  • e-Commerce
  • Бухгалтерия
  • Склад
  • PoS
  • Проекты
  • MRP
All apps
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Все посты Люди Значки
Теги (Смотреть все)
odoo accounting v14 pos v15
Об этом форуме
Помощь

Uncaught Odoo errors

Подписаться

Получайте уведомления о появлении активности в этом посте

Этот вопрос был отмечен
settingsuncaughterrorsundefinedodoo
1 Ответить
3121 Представления
Аватар
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
Аватар
Отменить
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.

Аватар
Gracious Joseph
Лучший ответ

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
Аватар
Отменить
Не оставайтесь в стороне – присоединяйтесь к обсуждению!

Создайте аккаунт сегодня, чтобы получить доступ к эксклюзивным функциям и стать частью нашего замечательного сообщества!

Регистрация
Похожие посты Ответы Просмотры Активность
i see this Error:Uncaught Promise > Cannot read properties of undefined (reading 'Symbol(html)')
settings docs uncaught undefined v15
Аватар
Аватар
1
янв. 23
27156
I cannot access to setting due to an error " Cannot read properties of undefined (reading 'string')"
settings errors
Аватар
Аватар
Аватар
Аватар
Аватар
4
мар. 23
8614
How to add new value in Selection in Settings Решено
settings selection odoo
Аватар
Аватар
1
мая 21
4638
Admin rights not working
settings users administration odoo
Аватар
Аватар
1
февр. 24
3095
How to disable export for no admin users in Odoo Studio?
settings export odoo Studio
Аватар
0
июн. 23
2603
Сообщество
  • Видео уроки
  • Документация
  • Форум
Открытый исходный код
  • Скачать
  • Github
  • Runbot
  • Перевод
Услуги
  • Хостинг Odoo.sh
  • Поддержка
  • Обновление
  • Индивидуальные решения по доработке
  • Образование
  • Найти бухгалтера
  • Найти партнера
  • Стать партнером
О нас
  • Наша компания
  • Активы бренда
  • Cвяжитесь с нами
  • Вакансии
  • Мероприятия
  • Подкаст
  • Блог
  • Клиенты
  • Правовые документы • Конфиденциальность
  • Безопасность
الْعَرَبيّة 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 – это набор бизнес-модулей с открытым исходным кодом, который закроет все потребности вашей компании: CRM, E-commerce, Бухгалтерия, Склад, POS, управление проектами и др.

Odoo сочетает в себе простоту использования и полную интеграцию всех бизнес-процессов в одной системе.

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