(fix) Remove stale src alias for esm-form-engine-lib causing build failure#1116
Merged
denniskigen merged 2 commits intomainfrom Mar 18, 2026
Merged
(fix) Remove stale src alias for esm-form-engine-lib causing build failure#1116denniskigen merged 2 commits intomainfrom
denniskigen merged 2 commits intomainfrom
Conversation
The alias '@openmrs/esm-form-engine-lib' -> 'src/index' was carried over from the Aug 2024 package rename. It pointed webpack at raw TypeScript source files in node_modules, which the swc-loader skips (exclude: /node_modules/), causing "Module parse failed: Unexpected token" build errors. Removing the alias lets webpack resolve the package normally through its compiled dist/index.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Size Change: -181 kB (-4.42%) Total Size: 3.91 MB
ℹ️ View Unchanged
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Summary
Removes a stale webpack alias that pointed
@openmrs/esm-form-engine-libto its raw TypeScript source files (src/index) instead of its compiled output (dist/index.js).The alias was introduced when the package was renamed from
@openmrs/openmrs-form-engine-libto@openmrs/esm-form-engine-lib(August 2024) and was carried over without accounting for the fact that the default webpack config excludesnode_modulesfrom the swc-loader. This caused webpack to encounter unprocessed TypeScript files and fail with:The same library works fine in
openmrs-esm-patient-chartbecause that repo does not have this alias — webpack resolves the package normally through itsdist/index.js.Removing the alias restores the correct resolution path and the build completes successfully.
Also, removed the alias for the framework.
This got flagged by all the failing jobs in the dependency update PR - #1111
Screenshots
Related Issue
Other