I have a webpack project with this in my "main.ts" module:
import {Elm} from "./MainModule";
it fails with:
TS2307: Cannot find module './MainModule'.
but when I switch my "tsconfig.json" from "module": "esnext"
to "module": "commonjs"
, it works.
However, I need "esnext"
in order to have code splitting.
Thoughts?
I had the same issue, adding "moduleResolution": "node",
to tsconfig.json
seems to have fixed it.
More info on it here: https://www.typescriptlang.org/docs/handbook/module-resolution.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With