Doesn’t resolve module with `moduleResolution: "classic"`
See original GitHub issueHi, with a file containing
import C from './components/C'
i get:
🚨 rpt2: /home/phil/Dev/Web/flying-sheep.github.com/src/index.tsx (4,15):
Cannot find module './components/C'.
even though it’s there:
$ tree src
src
├── components
│ └── C
│ ├── index.tsx
│ ├── style.css
│ └── style.css.d.ts
└── index.tsx
if i change it to this:
import C from './components/C/index'
i get:
🚨 Could not resolve './components/C/index' from
/home/phil/Dev/Web/flying-sheep.github.com/src/index.tsx
my tsconfig.json has:
"include": [
"src/**/*"
]
and my rollup.config.js:
plugins: [
nodeResolve(),
commonjs(),
typescript({
verbosity: 3,
clean: true,
check: true,
}),
]
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
TypeScript with classic moduleResolution work incorrect
As statet in the TypeScript Documentation: Module Resolution Strategy Classic: This used to be TypeScript's default resolution strategy.
Read more >Documentation - Module Resolution - TypeScript
If you are having resolution problems with import s and export s in TypeScript, try setting moduleResolution: "node" to see if it fixes...
Read more >Typescript does not resolve modules through tsconfig.json's ...
Unfortunately still seeing this issue. I have `moduleResolution: node` set as well. It seems that Webstorm is struggling to re-index and find ......
Read more >Configuring Module Resolution On Typescript and Jest
Step 1: Setting up a basic service. · Step 2: Configuring path resolution on tsconfig.js · Step 3: Configuring the NodeJS runtime to...
Read more >Module Resolution Strategy | TypeScript Tutorial - YouTube
Access 7000+ courses for 60 days FREE: https://pluralsight.pxf.io/c/1291657/424552/7490 "How does TypeScript compiler find a module ?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ah! so classic doesn’t consider
index.{js,ts}{x,}
. thanks!Setting module resolution to “node” works:
tsconfig.json