You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using microbundle to include "ical.js". It's modern and module options allow to include the bundled js as a <script type="module" src="bundle.js"></script>
However, when I start my application, I get the following error:
Now, in a normal environment <script src="bundle.js"></script>, this wouldn't be a problem as strict mode isn't enabled by default. For Javascript modules though, strict mode is always on:
ECMAScript 2015 introduced JavaScript modules and therefore a 3rd way to enter strict mode. The entire contents of JavaScript modules are automatically in strict mode, with no statement needed to initiate it.
I'm not sure how to handle this exactly, but a naive guess would have been to do further feature-detection. E.g. of ES6 modules. SO has an idea.
The text was updated successfully, but these errors were encountered:
Hi,
I'm using microbundle to include "ical.js". It's
modern
andmodule
options allow to include the bundled js as a<script type="module" src="bundle.js"></script>
However, when I start my application, I get the following error:
this is because
ICAL
is never officially initialized.https://github.com/mozilla-comm/ical.js/blob/dcfe5a67527e73f54db21fbc31f23670a29704b8/lib/ical/helpers.js#L11
Now, in a normal environment
<script src="bundle.js"></script>
, this wouldn't be a problem as strict mode isn't enabled by default. For Javascript modules though, strict mode is always on:I'm not sure how to handle this exactly, but a naive guess would have been to do further feature-detection. E.g. of ES6 modules. SO has an idea.
The text was updated successfully, but these errors were encountered: