Skip to content

fix: remove type:module to resolve CommonJS/ESM mismatch#17

Merged
AnJuHyppolite merged 1 commit intomainfrom
fix-require-error-#872
Dec 8, 2025
Merged

fix: remove type:module to resolve CommonJS/ESM mismatch#17
AnJuHyppolite merged 1 commit intomainfrom
fix-require-error-#872

Conversation

@AnJuHyppolite
Copy link
Copy Markdown
Contributor

Description

Fixes a CommonJS/ESM mismatch in feedback-widget.js that caused an Uncaught ReferenceError: require is not defined error when the 0.7.0 version of the widget was embedded in the UI claim status project. The issue occurred because the Feedback Widget's package.json contains "type": "module" while feedback-widget.js uses module.exports for Jest tests.

Ticket

This fix resolves Fix CommonJS/ESM mismatch causing require() errors when feedback widget is embedded.

Approach

  • Removed "type": "module" from package.json to resolve the mismatch, allowing correct parsing of feedback-widget.js as a CommonJS-compatible file.
  • Verified that feedback-widget.js continues to work in the browser.
  • Confirmed Jest tests still run successfully with require() and module.exports.

Steps to Test

  1. Embed the updated widget in the UI claim status page.
  2. Ensure the widget renders and functions without require is not defined error.

@AnJuHyppolite AnJuHyppolite changed the title fix: remove type:module to resolve Common JS/ESM mismatch fix: remove type:module to resolve CommonJS/ESM mismatch Dec 8, 2025
@AnJuHyppolite AnJuHyppolite force-pushed the fix-require-error-#872 branch from 0face66 to 5956f23 Compare December 8, 2025 19:23
@AnJuHyppolite AnJuHyppolite merged commit 23005f0 into main Dec 8, 2025
1 check 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.

1 participant