You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
isMatchWith.js:12 Uncaught ReferenceError: exports is not defined
at eval (isMatchWith.js:12:23)
at ../../node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js
I'm suspecting it comes due this part in the package.json
Would something like this fix the issue? I'm trying to understand why compat/* is the only one that has a different export pattern: default vs import + require.
Update: I can confirm that downgrading to 1.39.3 solves the issue. Looking at the package.json for 1.39.3 looks exactly what I suggested, could this be a regression?
I think this issue might be related to using an older webpack version or configuration. It's actually completely fine to import CommonJS files from ESM files in Node.js—that's why we only define CommonJS versions of compat/*. We're trying to keep our package size down, and having dual CommonJS/ESM files for everything would make the packages significantly larger.
Activity
jnavb commentedon Oct 18, 2025
Update: I can confirm that downgrading to 1.39.3 solves the issue. Looking at the package.json for 1.39.3 looks exactly what I suggested, could this be a regression?
raon0211 commentedon Oct 24, 2025
I think this issue might be related to using an older webpack version or configuration. It's actually completely fine to
importCommonJS files from ESM files in Node.js—that's why we only define CommonJS versions ofcompat/*. We're trying to keep our package size down, and having dual CommonJS/ESM files for everything would make the packages significantly larger.jnavb commentedon Oct 24, 2025
Closing the issue because I couldn't reproduce it in a minimal project.
For future visitors, the problem might be caused by the webpack configuration since the webpack version I'm using is the latest at this time 5.102.
fix(exports): provide ESM resolution for ./compat/* subpaths (#1757)