ankane / blazer

Business intelligence made simple
MIT License
4.5k stars 471 forks source link

TypeError: Vue is not a constructor #465

Closed sedubois closed 7 months ago

sedubois commented 7 months ago

The Blazer dashboard stays stuck on "Loading..." and the JS console shows Uncaught TypeError: Vue is not a constructor. The stack trace points to HTML line 87:

  var app = new Vue({
    el: "#queries",
    data: {
      searchTerm: "",
      more: more,
      updateCounter: 0
    },
  ...

The same error shows up when I click New Query.

I did not find particular installation or migration instructions related to Vue.js in the README, would you have any hints?

Using Blazer 3.0.3.

sedubois commented 7 months ago

As a workaround, the issue is "fixed" when downgrading from Blazer 3.0.3 to 2.6.5. Then the Blazer queries show up and new queries can be created.

ankane commented 7 months ago

Hi @sedubois, new Vue(...) isn't present in 3.0.3, so think it's something specific to your application.

sedubois commented 7 months ago

I see the code changed in v3:

https://github.com/ankane/blazer/commit/693d31d711129264df1292c466a55ac53383bda6#diff-10b88f6cb284838662e169dc198eb0232bcf568ef19ba6afc268f92e2417567aL37

Screenshot 2024-01-22 at 10 09 13

For some reason the view from version 2.6.5 keeps being rendered even when using gem version 3.0.3. Error happens in prod and dev. I tried:

sedubois commented 7 months ago

Found it: that specific view (app/view/blazer/queries/home.html.erb) was overridden by our application. Sorry for the noise!