Trying to use the Uber H3 API available on GitHub, there's an option for JavaScript. According to BigQuery documentation, this appears to be pretty straight forward on how to reference an external library and a function within in it. The line number the error is referencing looks like a normal import and not sure what exactly is being referenced as a module. It would appear that there are no other references pointing outside the library itself, and the folder structure is intact. Am I pointing at the wrong thing? How do I make BigQuery happy with using the H3 JavaScript library?
For reference, downloaded the H3 code base and loaded into a visible GCP Storage Bucket as used in the Google documentation.
Sample query
CREATE TEMP FUCNTION latLngToCell(lat FLOAT64, lng FLOAT64, res INT64)
RETURNS STRING
LANGUAGE js
OPTIONS (library = 'gs://gcbucket/h3-js-master/lib/h3core.js')
AS r"""
return latLngToCell(lat, lng, res);
""";
SELECT latLngToCell(37.38475, -122.34857, 7)
SyntaxError: Cannot use import statement outside of module at gs://gcbucket/h3-js-master/lib/h3core.js line 21, columns 0-6