Closed
Description
Description
Importing language files:
- seems to work in UMD module system
- seems to work in CommonJS although we should verify if the setup is optimal
- does not work in ESM in node
- does not work in ESM in React
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
- Originally reported by @guenlm in Using language with script and CDN #1340
- Consulted with @budnix in https://handsoncode.slack.com/archives/D0300KBP0H2/p1701186053349819 (internal discussion)
- The fix might require a breaking change.