esmock: Node 16.12+ breaks esmock
When upgrading to latest node, we’re seeing errors with using esmock
.
With some investigation, it looks like 16.12
is the version that broke esmock
.
How to reproduce
- Check out this repository
nvm use 16.11
npm ci
npm test
- Observe tests pass
nvm use 16.12
npm ci
npm test
- Observe many test failures
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (12 by maintainers)
I can confirm that the issue has been resolved 👍
Two changes fix this package for the latest versions of node,
format: 'module'
or an error is thrown.Here’s what I propose,
Maybe “getSource” should be kept rather than removed, I’m not sure.
@mroderick do you have any input?
cc @Swivelgames feel free to give your opinion or ignore as well.