If I install a new version of a package with different typescripts types, the webpack process started by react-scripts start command does not take into consideration the newly added types and results in a typescript error.
Environment Info:
current version of create-react-app: 5.0.1
running from /Users/iulian-bogdanvlad/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System:
OS: macOS 13.4
CPU: (10) arm64 Apple M1 Max
Binaries:
Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
Yarn: 3.6.4 - ~/.nvm/versions/node/v16.17.0/bin/yarn
npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
Browsers:
Chrome: 119.0.6045.199
Edge: Not Found
Firefox: 115.0.3
Safari: 16.5
npmPackages:
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
react-scripts: 5.0.1 => 5.0.1
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
Run create react app with typescript template.
Create a package P that contains some types and publish it to npm
Import the types from P in your app and use them somewhere
run npm start
Update the P package, by adding a new type.
Run npm install P to install the latest version while npm start is still running.
Import the new type and use it in your code.
npm start will complain that the new type does not exist and there is no way to make it work without restarting. The webpack bundling finishes correctly, but the type checking fails.
Expected behavior
I would expect that the newly added type to be seen by npm start without restarting it.
Actual behavior
I receive an error and I have to restart npm start to make it work again.
Reproducible demo
Here I have a simple CRA app. The project uses a library test-getting-started-genezio-typescript-newest_us-east-1 that has two versions: 1.0.0-local and 1.0.1-local the only difference between the two is that the 1.0.1 has a new type. First install 1.0.0, run npm start, then install 1.0.1, use the new type.
Describe the bug
If I install a new version of a package with different typescripts types, the webpack process started by
react-scripts start
command does not take into consideration the newly added types and results in a typescript error.Did you try recovering your dependencies?
not applicable
Which terms did you search for in User Guide?
Here https://facebook.github.io/create-react-app/docs/troubleshooting I have searched for "types".
Environment
Steps to reproduce
npm start
npm install P
to install the latest version whilenpm start
is still running.npm start
will complain that the new type does not exist and there is no way to make it work without restarting. The webpack bundling finishes correctly, but the type checking fails.Expected behavior
I would expect that the newly added type to be seen by
npm start
without restarting it.Actual behavior
I receive an error and I have to restart
npm start
to make it work again.Reproducible demo
Here I have a simple CRA app. The project uses a library
test-getting-started-genezio-typescript-newest_us-east-1
that has two versions:1.0.0-local
and1.0.1-local
the only difference between the two is that the 1.0.1 has a new type. First install 1.0.0, runnpm start
, then install 1.0.1, use the new type.