IssueRaiser

v5 used to include polyfills for node.js core modules by default

### Describe the bug Compiled with problems ### Did you try recovering your dependencies? ``` yarn --version 1.22.15 ``` ### Which terms did you search for in User Guide? react-scripts 5 webpack Module not found: Error: Can't resolve 'fs' ### Environment npx create-react-app --info Environment Info: ``` current version of create-react-app: 5.0.0 running from /Users/xxx/.config/yarn/global/node_modules/create-react-app System: OS: macOS 12.0.1 CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz Binaries: Node: 16.13.0 - /usr/local/Cellar/node@16/16.13.0/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 8.1.0 - /usr/local/Cellar/node@16/16.13.0/bin/npm Browsers: Chrome: 96.0.4664.93 Edge: Not Found Firefox: 94.0.1 Safari: 15.1 npmPackages: react: 17.0.2 react-dom: 17.0.2 react-scripts: 5.0.0 npmGlobalPackages: create-react-app: Not Found ``` ### Steps to reproduce In a project with react-scripts v5.0.0 1. yarn add -D dotenv 2. yarn start ### Expected behavior ### Actual behavior ``` ERROR in ../../node_modules/dotenv/lib/main.js 24:11-24 Module not found: Error: Can't resolve 'fs' in '../node_modules/dotenv/lib' @ ./src/config.ts 5:0-28 8:0-13 @ ./src/index.tsx 17:0-66 27:19-27 29:23-43 30:23-43 34:35-60 ERROR in ../../node_modules/dotenv/lib/main.js 26:13-28 Module not found: Error: Can't resolve 'path' in '../node_modules/dotenv/lib' BREAKING CHANGE: webpack < 5 used to include polyfills

Posted by damozhang on Dec 15, 2021, 12:59 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (SaaS)

v5 used to include polyfills for node.js core modules by default

damozhangDec 15, 2021, 12:59 AM

### Describe the bug Compiled with problems ### Did you try recovering your dependencies? ``` yarn --version 1.22.15 ``` ### Which terms did you search for in User Guide? react-scripts 5 webpack Module not found: Error: Can't resolve 'fs' ### Environment npx create-react-app --info Environment Info: ``` current version of create-react-app: 5.0.0 running from /Users/xxx/.config/yarn/global/node_modules/create-react-app System: OS: macOS 12.0.1 CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz Binaries: Node: 16.13.0 - /usr/local/Cellar/node@16/16.13.0/bin/node Yarn: 1.22.15 - /usr/local/bin/yarn npm: 8.1.0 - /usr/local/Cellar/node@16/16.13.0/bin/npm Browsers: Chrome: 96.0.4664.93 Edge: Not Found Firefox: 94.0.1 Safari: 15.1 npmPackages: react: 17.0.2 react-dom: 17.0.2 react-scripts: 5.0.0 npmGlobalPackages: create-react-app: Not Found ``` ### Steps to reproduce In a project with react-scripts v5.0.0 1. yarn add -D dotenv 2. yarn start ### Expected behavior ### Actual behavior ``` ERROR in ../../node_modules/dotenv/lib/main.js 24:11-24 Module not found: Error: Can't resolve 'fs' in '../node_modules/dotenv/lib' @ ./src/config.ts 5:0-28 8:0-13 @ ./src/index.tsx 17:0-66 27:19-27 29:23-43 30:23-43 34:35-60 ERROR in ../../node_modules/dotenv/lib/main.js 26:13-28 Module not found: Error: Can't resolve 'path' in '../node_modules/dotenv/lib' BREAKING CHANGE: webpack < 5 used to include polyfills

Comments (0)

No comments yet. Start the discussion.

Comment on this issue