You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since cspell-lib is an ESM Module, it cannot be used with import .. from in a commonjs package. Instead, it is necessary to use import().
I hope this helps.
Jason3S
changed the title
[Bug]: Importing cspell-lib gives Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in node_modules/cspell-lib/package.json
Q: How to import spellCheckDocument from cspell-lib using tsx from a package with type module or commonjs?
Dec 26, 2024
Kind of Issue
Change in behavior / Regression
Tool or Library
cspell-lib
Version
8.17.1
Supporting Library
Not sure / None
OS
Linux
OS Version
wsl
Description
When I try:
and run
I get
When I add "type": "module" to my package.json, this fixes the issue, but breaks another local dependency which I've imported which is commonjs.
Steps to Reproduce
No response
Expected Behavior
No response
Additional Information
No response
cspell.json
No response
cspell.config.yaml
No response
Example Repository
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: