-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src subdirectory files does not update react app #11855
Comments
Another interesting note. If edit a file and save the changes in src/pages or src/components. Then copy the file to the src directory and then update the path in src/App.tsx, something like |
Here's a video of what I mean. |
Also every time I run (node:21783) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
node:internal/modules/cjs/loader:936 Error: Cannot find module '/mnt/d/Repositories/html/dosx001.github.io/...' Node.js v17.3.0 |
I checked out this page.
Also, I am using Vim. I updated my .vimrc with I even created a .env file with I switched to VS Code and used WSL Remote but I was having the same exact experience. Also, I restarted the App every time for each step. |
I have raised the following issue for this: #11860 |
Describe the bug
I only started learning React this week. Everything was working fine when all files were under the src directory. Then I made subdirectories like src/pages and src/components, and moved some files to those directories. If edit files like src/App.js then the React app would update. However, if edit something like src/pages/Home.tsx, the React app would not be updated unless I restart the server.
Did you try recovering your dependencies?
It's a fresh new project. Not an option.
Which terms did you search for in User Guide?
npm start doesn’t detect changes
src subdirectories
src subdirectory files not updating react app
Environment
Windows 10 19043.1215
WSL 2: Arch Linux
https://github.com/yuk7/ArchWSL
Environment Info:
current version of create-react-app: 5.0.0
running from /home/dosx/.npm/_npx/c67e74de0542c87c/node_modules/create-react-app
System:
OS: Linux 5.10 Arch Linux
CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
Binaries:
Node: 17.3.0 - /usr/sbin/node
Yarn: 1.22.17 - /usr/sbin/yarn
npm: 8.3.0 - /usr/sbin/npm
Browsers:
Chrome: Not Found
Firefox: 95.0.2
Edge: 96.0.1054.62
npmPackages:
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
react-scripts: 5.0.0 => 5.0.0
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
Edit any file under src/pages or src/components
Expected behavior
React app would update when editing all files in the src directory.
Actual behavior
When editing files under src/pages and src/components React app does not update.
Reproducible demo
https://github.com/Dosx001/dosx001.github.io
The text was updated successfully, but these errors were encountered: