Skip to content

Fix: Finish migration to Webpack 5, add ProvidePlugin for process polyfill to resolve "process is not defined" error#181

Merged
bghcore merged 3 commits intomicrosoft:mainfrom
bghcore:webpack5
Jan 29, 2026
Merged

Fix: Finish migration to Webpack 5, add ProvidePlugin for process polyfill to resolve "process is not defined" error#181
bghcore merged 3 commits intomicrosoft:mainfrom
bghcore:webpack5

Conversation

@bghcore
Copy link
Contributor

@bghcore bghcore commented Jan 27, 2026

Thank you for your contribution. Before submitting this PR, please include:

Id of the task, bug, story or other reference

Description

Fixes "process is not defined" error occurring in CICD fresh builds by properly configuring webpack 5 to polyfill Node.js process global for browser environments.

Problem

After upgrading to webpack 5 in v0.5.20, the SDK bundle was failing in CICD with ReferenceError: process is not defined. This error occurred because:

  • Webpack 5 removed automatic Node.js polyfills that were present in webpack 4
  • The axios dependency uses process.nextTick internally
  • The SDK's webpack config had resolve.fallback but was missing ProvidePlugin to inject the global
  • Local builds worked due to webpack filesystem caching, but CICD fresh builds exposed the issue

Changes

  1. webpack.common.js
    - Added webpack.ProvidePlugin to automatically inject process/browser polyfill when code references process global
    - Added resolve.fallback configuration for process/browser
  2. package.json
    - Added process@0.11.10 to devDependencies
    - Bumped version to 0.5.21
  3. CHANGELOG.md
    - Documented the fix and changes for v0.5.21

Solution Proposed

Detail what is the solution proposed, include links to design document if required or any other document required to support the solution.

Acceptance criteria

Define what are the conditions to consider the PR has achieved the intended goal

Test cases and evidence

Include what test cases were considered, any evidence of testing for future references, to identify any corner cases, etc.

Sanity Tests

  • You have tested all changes in Popout mode
  • You have tested all changes in cross browsers i.e Edge, Chrome, Firefox, Safari and mobile devices(iOS and Android)
  • Your changes are included in the CHANGELOG

A11y

*Please provide justification if any of the validations has been skipped._

@bghcore bghcore changed the title Fix: Add webpack ProvidePlugin for process polyfill to resolve "process is not defined" error Fix: Finish migration to Webpack 5, add ProvidePlugin for process polyfill to resolve "process is not defined" error Jan 29, 2026
@bghcore bghcore merged commit 3dcea70 into microsoft:main Jan 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants