hebcal/hebcal-es6

Cannot use with Typescript

Closed this issue · 2 comments

mkdir -p /tmp/hc
cd /tmp/hc
npm init -y
npm i typescript @hebcal/core @hebcal/noaa tslib
echo "export * from '@hebcal/core'" > index.ts
cat >tsconfig.json <<EOL
{
  "include": ["index.ts"],
  "compilerOptions": {
    "target": "ES2022",
    "module": "NodeNext",
    "declaration": true,
    "moduleResolution": "NodeNext",
    "importHelpers": true,
    "sourceMap": true,
    "inlineSources": true
  }
}
EOL
npx tsc

node_modules/@hebcal/core/hebcal.d.ts:1:29 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@hebcal/noaa")' call instead.

1 import { GeoLocation } from '@hebcal/noaa';
~~~~~~~~~~~~~~

Found 1 error in node_modules/@hebcal/core/hebcal.d.ts:1

See #365

This issue appears to be fixed now. Tested with current versions @hebcal/core@5.0.3 and @hebcal/noaa@0.8.11

Confirmed this is working. @shul/elements@0.0.31 uses this. Thank you!
מי שברך אבותינו הוא יברך אותך על זה שאתה מזכה את הרבים, הקב׳׳ה ישלם שכרך ויסיר ממך כל מחלה וירפא לגופך ויסלח לכל העוונות וישלח ברכה והצלחה בכל מעשה ידך עם כל ישראל אחיך אמן