handsontable / hyperformula

HyperFormula is an open-source headless spreadsheet for business web apps. It comes with over 400 formulas, CRUD operations, undo-redo, clipboard support, and sorting.
https://hyperformula.handsontable.com/
Other
1.9k stars 108 forks source link

Language files do not work with ES modules in node #1344

Open sequba opened 7 months ago

sequba commented 7 months ago

Description

Importing language files:

Demo

https://codesandbox.io/p/devbox/test-hyperformula-with-nodejs-pgkwd8

Error messages

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/workspaces/sandbox/node_modules/hyperformula/es/i18n/languages/frFR' imported from /workspaces/sandbox/index.js
Did you mean to import hyperformula/es/i18n/languages/frFR.js?
(node:328) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/workspaces/sandbox/node_modules/hyperformula/es/i18n/languages/frFR.js:417
export default dictionary;
^^^^^^

SyntaxError: Unexpected token 'export'

Notes

Related issues

sequba commented 5 months ago

Relevant discussion: