mrsimpson / energy

A calculator for cost of energy (gas)
https://gaspreis.no-panic.org
Apache License 2.0
3 stars 0 forks source link

Bypass Typescript for vue-matomo #66

Closed mrsimpson closed 1 year ago

jschirrmacher commented 1 year ago

Why do you use require here? Is it because of the async nature of import? This could also be solved by awaiting the symbol or just - as documented in vue-matomo - by using window._paq.push(['trackPageView'])

jschirrmacher commented 1 year ago

Actually, I get Uncaught ReferenceError: require is not defined at main.b6cfe21a.js:1833:48878 now

jschirrmacher commented 1 year ago

The problem is, that require is a node.js thing. In a browser, it is not defined.

jschirrmacher commented 1 year ago

You might use the import() function to dynamically load files, but this would be async as well and won't help. I think, the only real solution is to use window._paq.push()