Skip to content

Embed uuid package for Webpack 4#5445

Merged
compulim merged 3 commits intomicrosoft:mainfrom
compulim:fix-webpack4-speech-sdk
Mar 13, 2025
Merged

Embed uuid package for Webpack 4#5445
compulim merged 3 commits intomicrosoft:mainfrom
compulim:fix-webpack4-speech-sdk

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented Mar 13, 2025

Fixes #5446.

Changelog Entry

Changed

  • Fixed #5446. Embedded uuid so microsoft-cognitiveservices-speech-sdk do not need to use dynamic loading, as this could fail in Webpack 4 environment, in PR #5445, by @compulim

Description

Issues related to Webpack 4 when it tries to statically analyze dependencies.

The way microsoft-cognitiveservices-speech-sdk imported the uuid package (in their Guid.js) is causing esbuild/tsup to create a proxy for require() for dynamic loading.

image

When this __require() appears in Web Chat, Webpack 4 will fail to statically analyze dependencies and complain "Critical dependency: require function is used in a way in which dependencies cannot be statically extracted."

We need to embed uuid inside Web Chat temporarily for now. We need to add automated test for Webpack 4 later.

Specific Changes

  • Added uuid to tsup/noExternal
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review March 13, 2025 11:13
@compulim compulim enabled auto-merge (squash) March 13, 2025 11:14
@OEvgeny
Copy link
Copy Markdown
Collaborator

OEvgeny commented Mar 13, 2025

Have you checked if a single uuid instance got embedded @compulim ?

@compulim compulim merged commit cd86ef9 into microsoft:main Mar 13, 2025
25 checks passed
@compulim compulim deleted the fix-webpack4-speech-sdk branch March 13, 2025 16:44
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.

Webpack 4 is throwing "Critical dependency: require function is used in a way in which dependencies cannot be statically extracted"

2 participants