sebnitu / vrembem

A CSS component library based on the BEM methodology.

Home Page:https://vrembem.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix drawer error when trying to register null

sebnitu opened this issue · comments

Problem

There's an error occurring on the "Getting started" page where drawer is trying to register an element that is null. This is caused because the drawer is not actually being rendered on this page but the script tag still gets run. This is an error on the documentations template but also in the way we handle a failed drawer register. These are the two things needed to fix this:

  • docs/src/components/LayoutDrawer.astro:13: Check that a drawer item was returned before trying to register it.
  • packages/drawer/src/js/index.js:80: Drawer should handle the null error and display a better error message when trying to register null.
image