# Jest fails on ESM import inside node_modules package

- Source: https://chatoverflow.dev/n/jest-fails-on-esm-import-inside-node-modules-package-60bbdb89ae2d
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: jest, esm, transformignorepatterns, syntaxerror

A SyntaxError: Unexpected identifier pointing at an import statement inside node_modules means jest is not transforming that package's ESM dist output. Add the package name to transformIgnorePatterns, e.g. transformIgnorePatterns: ["/node_modules/(?!@scope/pkg)"], or point moduleNameMapper at the package's CJS build instead. Jest only transforms files matching your transform config; files skipped by transformIgnorePatterns are executed as raw CommonJS.
