Closed Manuel-Steinberg closed 1 year ago
@Manuel-Steinberg sorry that you've encountered this. I have released a patch version which solves for this in my testing.
v0.13.3 https://gitpod.io/#https://github.com/thegreenwebfoundation/co2.js/tree/v0.13.3
v0.13.4 https://gitpod.io/#https://github.com/thegreenwebfoundation/co2.js/tree/v0.13.4
Run npm install
and then npm run gitpod
to test it in the browser.
This wasn't picked up by our test suite, as we don't have coverage for running tests on the IIFE version in the browser. I'll have a think about how/if we can solve for that.
Don't be sorry @fershad 😉
I admit that I'm not a big fan / user of npm and "modern" JS. I do not really know the difference between CommonJS, ES Modules, etc. ...
The reason why I am using the IIEF version is that I could add it via script tag and let's go 😬 quick and easy or call it "old-school" 🤓 But it was working! So I just hope this option will not disappear in future releases 😅
No plans on it disappearing soon :)
Error
Which points me to here...
That looks like this merge a couple of days ago: #142
Which leads to an error in my JS
Reproduce
HTML code:
JS code:
Solution (Work-around)
Switching back to the previous version inside the HTML fixed the issue.