JS errors in 4.1.2

Hi,

I just created and sent a new invoice. All good.

I then updated to 4.1.2 using the update script. Script reported all was fine.

Now, no numbers or graphs are shown on the dashboard. Also, not a single input field on the ‘Edit invoice’ pages work (i.e. contain anything), nor does the invoice preview.

This is using recent versions of both Google Chrome and Firefox.

Both the error logs and DevTools in Chrome tell me:

Uncaught ReferenceError: fx is not defined
    at dashboard:368
(anonymous) @ dashboard:368
dashboard:451 Uncaught TypeError: NINJA.parseFloat is not a function
    at formatMoney (dashboard:451)
    at Object.callback (dashboard:873)
    at a.<anonymous> (Chart.js:7014)
    at Array.map (<anonymous>)
    at a.convertTicksToLabels (Chart.js:7010)
    at a.convertTicksToLabels (Chart.js:9439)
    at a.update (Chart.js:6934)
    at n (Chart.js:6045)
    at Object.o.each (Chart.js:4807)
    at Object.update (Chart.js:6035)

This is for the Dashboard as well as the Edit page. More pages, possibly. Could it be I’m missing a JS file or something? I’m not seeing any 404s. Should I update manually?

Tried switching back and forth between PHP 7.0 and 7.1, to no avail.

Tried to manually upload the latest zip, unzip all files, fully replacing the older ones, restoring my .env: same error.

Then put a backup of the old (3.9.2) back and everything other than PDF previews in the latest Firefox works again. In Chrome, all is well, including the preview.

Seeing a couple of these in Firefox (DevTools – F12), by the way:
unreachable code after return statement edit:3679:8

Have you tried force refreshing page to clear the browser cache?

Hi all,

a little bit outdated, but i get the same errors after having upgraded from 3.9 (docker.io/invoiceninja/invoiceninja) to 4.3.1 (also docker image)

Loading failed for the <script> with source “https://domain.tld/js/cookieconsent.min.js”. create:205 ReferenceError: fx is not defined[Learn More] create:461:5 Failed to log error create:131:17 ReferenceError: trackEvent is not defined Stack trace: window.onerror@https://domain.tld/quotes/create:129:17 create:132:17 unreachable code after return statement[Learn More] create:4056:8 TypeError: NINJA.parseFloat is not a function[Learn More] create:3031:20 TypeError: window.cookieconsent is undefined[Learn More] create:208:9 unreachable code after return statement[Learn More] create:4056:8

Clearing the browser cache does not work, are there any other debugging steps i could take?

Kind regards,

Rouven

I’m not sure, you may want to see if you can replicate the issue with a clean install.

Hi Hillel,

thanks for the ultra-fast reply. I didn’t reuse any docker volumes from the 3.9 install so i’d say this already counts as a clean install.

Cheers,

Rouven

I’d suggest creating an issue on our dockerfiles repo

https://github.com/invoiceninja/dockerfiles

No one else has reported this issue, it seems more likely to be a configuration issue.

Hi Hillel,

you were right, it was a config error on my side.

The front-facing nginx was pointing to a document root from 3.9 so it was serving outdated/ wrong js and css files from app/public/.

Thanks for your kind help!

Rouven

Glad to hear it’s working!

Retried installing the latest version, manually unpacking the zip and everything: same thing. Created a new .env as quite a few things seemed to have changed in the sample file, but alas: same JS errors.

Everything loading, version no. showing up OK, but these JS errors.

I have no idea how to proceed. What other config items are there that need set?

It seems to be working now, strangely. Suspecting something something Cloudflare now.

Thanks for the update, glad to hear it’s working!