Subscribe on changes!

Error only in build (TypeError: Cannot read property 'insertBefore' of null) with v-if and data property updates

avatar
Jul 16th 2021

Version

3.1.4

Reproduction link

https://github.com/mschoeffel/vite-build-error

Steps to reproduce

  1. Pull Github Repo
  2. Start with either npm run serve to see how it should work. Or deploy the dist directory after npm run build to any webserver like nginx to get the errors.
  3. Open in browser localhost:3000 or the URL of the webserver or my deployed link.(see aditional info)
  4. Log in via Username: John.Doe@mail.com - Password: test123
  5. Navigate to /apartments or with the navigation bar on the left side Wohnungen.
  6. Error 1: Select an apartment from the list and click on it again to deselect it. -> Now no apartment can be selected anymore and the error appears in the console. Reload is required to get it working again. (Switching from one apartment to the other works fine. The error only occurrs if deselecting the currently selected apartment)
  7. Error 2: If inputting something into the search input at the top of the same page the apartments get filtered accordingly(eg. enter Rund) if then removing the searchinput all apartments appear again. But if you select one apartment of the filtered list and the remove the searchinput you get errors and the list doesn't get updated.

What is expected?

The GUI is updated accordingly. Error 1: Apartment Details is shown/hidden. Error 2: The apartmentlist is updated.

What is actually happening?

GUI freezes and Error "TypeError: Cannot read property 'insertBefore' of null" is logged.

In dev everything works fine as expected and no errors or warnings are logged.


avatar
Jul 16th 2021

Your repro is far from minimal. Please open a new issue if you manage to reproduce it down with only Vue (no ui libs, no router, not ta, no tests, etc) and with a boiled down component. Usually this should kind of error should be reproducible with the SFC playground.

You can always use the chat to ask questions