Issue with Running Codemods for Migrating to React Query v5 Due to ESM Compatibility #7048
-
I've encountered a problem when trying to run the provided codemods for migrating to React Query v5, specifically related to the ESM compatibility issues in Node.js. I followed the migration guide and used jscodeshift to apply the remove-overloads.js codemod, but the process fails due to ESM module loading constraints. SummaryI've encountered a problem when trying to run the provided codemods for migrating to React Query v5 (from v4), specifically related to the "ESM compatibility issues in Node.js". I followed the migration guide and used Environment
Steps I followed
Encountered the following error indicating an issue with ESM compatibility:
the output at the end of the script is as follows: Node.js v18.18.2
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 0.320seconds
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
@lachlancollins does tsup add @nadavschwartz can you try to just rename the file to |
Beta Was this translation helpful? Give feedback.
the issue is resolved either by renaming all CommonJS files in codemods to .cjs, or by adding the package.json in the published codemods directory. since the project mainly uses ES modules it makes sense to name the CommonJS files .cjs. I created a pull request #7333