Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Can't find certain modules when reloading on saved changes (watcher) #368

Open
@Fabiantjoeaon

Description

@Fabiantjoeaon

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Which terms did you search for in User Guide?

Reloading, module reloading, watcher

Environment

  1. npm ls react-scripts-ts (if you haven’t ejected):
    react-scripts-ts@2.15.1
  2. node -v:
    v8.11.2
  3. npm -v:
    4.6.1
  4. yarn --version (if you use Yarn):
    1.7.0
  5. npm ls react-scripts-ts (if you haven’t ejected):
    react-scripts-ts@2.15.1

Then, specify:

  1. Operating system:
    macOS 10.13.4
  2. Browser and version (if relevant):
    Chrome 67.0.3396.99 64-bit

Steps to Reproduce

Expected Behavior

I'm using create-react-ts with pixi.js (and @types/pixi.js), for using additional filters I installed the module pixi-filters, I expected everything to go well in my workflow.

Actual Behavior

Everytime I run yarn start, the build process proceeds without problems, however, when reloaded using watchers, sometimes I get Cannot find module pixi-filters, which has been installed correctly.
Because of the type definitions, I imported it as import * as filters from "pixi-filters"; instead of import filters from pixi-filters`` (not sure if this matters).

This is however, not the only module it happens to, also a custom module which we install through SSH.

When I run yarn start again, it's fixed. Might be something to do with timing?
This is my tsconfig:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs",
        "typeRoots": ["node_modules/@types"],
        "sourceMap": true,
        "removeComments": false,
        "outDir": "build",
        "noImplicitAny": true,
        "alwaysStrict": true,
        "strictNullChecks": true,

        "noUnusedLocals": false,
        "noUnusedParameters": false,

        "noImplicitReturns": true,
        "noImplicitThis": true,

        "noFallthroughCasesInSwitch": true,
        "allowSyntheticDefaultImports": true,
        "moduleResolution": "node",
        "baseUrl": "src",
        "jsx": "react",
        "declaration": true,
        "allowJs": false
    },
    "compileOnSave": false
}

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions