Can't find certain modules when reloading on saved changes (watcher) #368
Description
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
npm ls react-scripts-ts
(if you haven’t ejected):
react-scripts-ts@2.15.1node -v
:
v8.11.2npm -v
:
4.6.1yarn --version
(if you use Yarn):
1.7.0npm ls react-scripts-ts
(if you haven’t ejected):
react-scripts-ts@2.15.1
Then, specify:
- Operating system:
macOS 10.13.4 - 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.)