Skip to content

Problem finding modules for starter project #10346

@waderyan

Description

@waderyan

From @jankalfus August 10th

Sometimes when I open my project, VS Code is unable to find imported external modules. I've got typings for the modules installed, all files in the project compiles fine using tsc, but I get red squiggly lines in the editor. The weird thing is that I get the squiggly lines only for some .tsx files, while it works for others.

The file src/web/App.tsx is fine:
web

While I get squiggly lines for the file src/native/App.tsx:
native

My tsconfig.json content is the following:

{
    "compilerOptions": {
        "allowSyntheticDefaultImports": false,
        "jsx": "react",
        "noImplicitAny": true,
        "experimentalDecorators": true,
        "module": "commonjs",
        "target": "es5",
        "rootDir": "src"
    },
    "exclude": [
        "node_modules",
        "src/native",
        "app",
        "app-native",
        "tools",
        "test"
    ]
}

Both react and react-native are installed as global typings.

Unfortunately, I cannot post the source code right now, but basically, the structure of the source files is as following:

src
 |-- common
 |-- native
       |-- index.ts
       |-- App.tsx
 |-- web
       |-- App.tsx
 |-- index.ts (this one is for web)
  • VSCode Version: 1.4.0
  • OS Version: Windows 10

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptNeeds More InfoThe issue still hasn't been fully clarifiedVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions