-
Notifications
You must be signed in to change notification settings - Fork 152
Description
Environment
- Prettier version: 3.5.1
- Node version: [18, 20] (tested with both)
- IDE: VS Code
Bug
After updating VS Code to version 1.104, this plugin stopped working and started throwing the following error:
Error [ERR_INTERNAL_ASSERTION]: Unexpected module status 0. Cannot require() ES Module /XXXX/node_modules/prettier/plugins/babel.mjs because it is not yet fully loaded. This may be caused by a race condition if the module is simultaneously dynamically import()-ed via Promise.all(). Try await-ing the import() sequentially in a loop instead. (from /XXXX/node_modules/@trivago/prettier-plugin-sort-imports/lib/src/index.js)
I reproduced this on two other machines: it worked fine before the update, but after updating, the same error appears.
Steps to Reproduce
- Update to version 1.104 of VS Code.
- Check the OUTPUT panel filtered on Prettier.
- Observe the above error.
- Comment out trivago/prettier-plugin-sort-imports in the Prettier config.
- Reload VS Code.
- Check the OUTPUT panel filtered on Prettier.
- Notice that the error no longer occurs.
Expected Behavior
Prettier and the plugin should continue to work normally without errors.
Notes
This may be a VS Code issue, but it seems like the plugin could potentially handle this more gracefully as well.