Skip to content

Commit f3c333d

Browse files
committed
chore: link to ESM docs on syntax error
1 parent a7e0912 commit f3c333d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- `[jest-config]` Throw correct error for missing preset modules ([#10737](https://github.com/facebook/jest/pull/10737))
1515
- `[jest-resolve-dependencies]` Resolve mocks as dependencies ([#10713](https://github.com/facebook/jest/pull/10713))
1616
- `[jest-runtime]` Handle file URLs in dynamic imports ([#10744](https://github.com/facebook/jest/pull/10744))
17+
- `[jest-transform]` Link to ESM docs on syntax errors ([#10748](https://github.com/facebook/jest/pull/10748))
1718

1819
### Chore & Maintenance
1920

packages/jest-transform/src/enhanceUnexpectedTokenMessage.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ This usually means that you are trying to import a file which Jest cannot parse,
4242
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
4343
4444
Here's what you can do:
45+
${DOT}If you are trying to use ECMAScript Modules, see ${chalk.underline(
46+
'https://jestjs.io/docs/en/ecmascript-modules',
47+
)} for how to enable it.
4548
${DOT}To have some of your "node_modules" files transformed, you can specify a custom ${chalk.bold(
4649
'"transformIgnorePatterns"',
4750
)} in your config.

0 commit comments

Comments
 (0)