Today I was upgrading chai to it’s new Major version 5 (Note I’m on Meteor 2.14 with this).
Chai 5 is ESM-only now but I thought the Meteor tool will likely to handle that easily.
However, I once I want to import it in a test file via
import chai from 'chai'
I get the following error:
W20240201-10:12:53.327(1)? (STDERR) packages/modules.js:1362
W20240201-10:12:53.328(1)? (STDERR) static {
W20240201-10:12:53.328(1)? (STDERR) ^
W20240201-10:12:53.328(1)? (STDERR)
W20240201-10:12:53.329(1)? (STDERR) SyntaxError: Unexpected token '{'
W20240201-10:12:53.329(1)? (STDERR) at new Script (vm.js:102:7)
W20240201-10:12:53.329(1)? (STDERR) at createScript (vm.js:262:10)
W20240201-10:12:53.329(1)? (STDERR) at Object.runInThisContext (vm.js:310:10)
W20240201-10:12:53.329(1)? (STDERR) at /tmp/meteor-test-run1y1opir.pssv/.meteor/local/build/programs/server/boot.js:354:32
W20240201-10:12:53.329(1)? (STDERR) at Array.forEach (<anonymous>)
W20240201-10:12:53.329(1)? (STDERR) at /tmp/meteor-test-run1y1opir.pssv/.meteor/local/build/programs/server/boot.js:210:21
W20240201-10:12:53.329(1)? (STDERR) at /tmp/meteor-test-run1y1opir.pssv/.meteor/local/build/programs/server/boot.js:423:7
W20240201-10:12:53.329(1)? (STDERR) at Function.run (/tmp/meteor-test-run1y1opir.pssv/.meteor/local/build/programs/server/profile.js:256:14)
W20240201-10:12:53.329(1)? (STDERR) at /tmp/meteor-test-run1y1opir.pssv/.meteor/local/build/programs/server/boot.js:422:13
Anyone has similar issues with other ESM-only packages?
Is this maybe related to this post: