When I had a thought, the code wasn't fully visible, but... Have you made sure to request this package BEFORE
any other JavaScript
that relies on this function?
Something along the lines of this:
<script src="unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3f5c5051495a4d4b124a51564b4c7f0d110c110b">[email protected]</a>/lib/index.js"></script>
<script src="...ROUTE_TO_JAVASCRIPT"></script>
Otherwise, if you call the package functions before importing it, those functions will be undefined
.
Therefore, keep in mind that sequence matters in this particular situation.
If that's the case, make sure to import the module wherever you use it:
var convert = require('convert-units')