Issue
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?
Solution
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
Answered By - m0tive
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.