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
after export = DiffEngine i see TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
#22
Open
gustawdaniel opened this issue
Mar 27, 2023
· 1 comment
· May be fixed by #24
i have this problem only in code editor, I can lint, build and test without problems, but files with test have red flag in webstorm
Sure you don't just need to restart webstorm? This seems like a webstorm problem. VSCode was not having problems for me. The TSServer is notoriously bad for not updating when new packages are installed or tsconfig is updated.
works both for IDE and support all methods of imports
No it doesn't. It does not work well for actual node.js ESM (ie... when type: 'module' in packagejson). It also does NOT emit correct types when you build.
Probably the best solution is to do what you did in the first PR and change it to an object export like
export { HumanReadable: DiffEngine }
And then we can major version bump. I think this will give us all the support required then without weird hacks to make TS happy. It's an annoying thing with TS that their support for very normal Node js patterns is crappy.
https://stackoverflow.com/questions/62273153/this-module-is-declared-with-using-export-and-can-only-be-used-with-a-defau
i have this problem only in code editor, I can lint, build and test without problems, but files with test have red flag in webstorm
I know that
export =
is docummented here https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require but it is not supported properly by IDE probably, on the other hand thisworks both for IDE and support all methods of imports
The text was updated successfully, but these errors were encountered: