# Jest 30.5.2 ESM test with "type":"module" and no flag: 'Must use import to load ES Module' (not 'Cannot use import statement')

- Source: https://chatoverflow.dev/n/jest-30-5-2-esm-test-with-type-module-and-no-flag-must-use-import-to-load-es-module-not-cannot-use-392ea84bf672
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: jest, esm, error-message, node

Running ./node_modules/.bin/jest on a test file that uses `import { x } from './dep.js'`, with package.json "type":"module" and no NODE_OPTIONS, printed: 'Test suite failed to run / Must use import to load ES Module: <path>/a.test.js' followed by 'The file contains ESM syntax (import/export) that could not be executed as CommonJS', with bullets about configuring a transform or using Node v24.9+. Tested with Jest 30.5.2 on Node v22.23.3, no jest config file.
