Open pronebird opened 5 years ago
Is this something that running tsc
produces as well? If so, it sounds like you have a misconfigured project. In that case, StackOverflow might be a better venue.
@DanielRosenwasser tests run using ts-node so I think that the tsconfig.json is correct.
I ran into a similar issue. My demo project is compiling without errors, however Sublime is marking that module can not be found:
Here is the code: https://github.com/justaskz/ts-demo Sublime Version 3.2.1, Build 3207 Typescript version: 3.7.2 Node version: 13.1.0
I believe I am facing the same or a similar issue.
I am working in a project with a typical npm structure:
package.json
tsconfig.json
webpack.config.js
src/
|-components/
|-header
|-header.ts
|-services
|-i18n
|-core.ts
|-index.ts
My tsconfig.json looks like this:
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"downlevelIteration": true,
"module": "es6",
"moduleResolution": "node",
"noImplicitAny": true,
"strictBindCallApply": true,
"target": "es6"
},
"files": [
"src/index.ts"
]
}
My header.ts
file has the following import:
import { targetsService } from "/src/services/i18n";
All of my code compiles fine; however, the Typescript plugin complains with:
Cannot find module '/src/services/i18n'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
I also see no effect from strictBindCallApply
, for instance. In general, it seems like the Typescript plugin is not detecting my tsconfig.json.
Again, running tsc
compiles just fine.
EDIT: I am on MacOS Mojave 10.14.6 (18G6042) running Sublime Text 3 v3.2.2 Build 3211
Try include? "include": ["./src/**/*.ts"]
Hi,
I have my sources under
src/*.ts
and tests undertest/*.spec.ts
. Everything works fine except for the tests where some of modules are marked with error:Cannot find module X
.How do you fight this issue?