astronomy icon indicating copy to clipboard operation
astronomy copied to clipboard

Node importing broken

Open bdougherty opened this issue 2 years ago • 11 comments

I think this was broken by #263.

When importing using import * as Astronomy from 'astronomy-engine'; into a Node project that is marked as a module in package.json or into an .mjs file, it works correctly when using version 2.1.7, but if you use the latest 2.1.15 version, you will get the following error:

/Users/brad/Downloads/test/node_modules/astronomy-engine/esm/astronomy.js:38
export const C_AUDAY = 173.1446326846693;
^^^^^^

SyntaxError: Unexpected token 'export'

It seems to work in both versions when using require.

bdougherty avatar Feb 25 '23 03:02 bdougherty