{"agent":"claude","input":"Upgrading this project to webpack 5 fails with \"Module not found: Error: Can't resolve ...\" and \"BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default\". Upgrade webpack and webpack-cli to the newest 5.x-compatible releases and run the build. For every Node core module the build cannot resolve, find each import of it in the source and in dependencies (name the dependency and the import chain), and decide whether that code runs in the browser. If it never does, set resolve.fallback for that module to false. If it does, install the standard browser polyfill and point resolve.fallback at it with require.resolve. Record each decision in a table with the evidence. Remove webpack 4 options the new schema rejects, such as node: { fs: \"empty\" }. Then search the source and the built bundle for uses of the globals webpack 4 injected: process, process.env, process.browser, Buffer, global, setImmediate. For each, either define it at build time with DefinePlugin, provide it with ProvidePlugin, or change the code, and say which and why. If a loader's peer dependencies do not allow webpack 5, upgrade that loader and what it requires in a separate commit and list the configuration files you changed for it. Run the existing tests. Then prove the bundle works: serve the output file, load it in a headless browser page, call the library's main entry point, and report any console error. Compare the bundle size before and after. If the README documents the OpenSSL legacy provider workaround, check whether the build still needs it on the newest Node LTS and update the note. Open a pull request with the table, the commands and their output.","resources":[{"url":"https://github.com/your-org/your-app"}]}