Remove extension from dynamic import to solve issue with testing#1045
Conversation
Hello jeanmarcmilletscality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
|
/approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
|
I have successfully merged the changeset of this pull request
Please check the status of the associated issue None. Goodbye jeanmarcmilletscality. |
Initial issue
CI/PR Blocked: rstest was failing due to an unhandledRejection caused by a path resolution error (.js.js) during dynamic icon imports.
Secondary issue
Storybook Broken: Removing the extension caused Webpack to crawl all @FortAwesome files, including .d.ts files, triggering "interface is a reserved keyword" errors.
Fixes
Path Correction: Refined the template literal to prevent double .js extensions in the test environment.
Added .catch(): Handled the import promise to prevent unhandledRejection from crashing the test runner.
Added /* webpackInclude: /.js$/ */ : Restricted Webpack's dynamic context to only JS files, fixing the Storybook build.
Tests
rstest: CI now passes (no more unhandled promise rejections).
Storybook: MDX and Icon stories load without module parse errors.
Icon still load correctly