mockaroo-node
mockaroo-node copied to clipboard
[BUGFIX] CommonJS Imports Broken
Issue
The release of v1.0.1, while working locally and passing unit tests, failed to resolve imports when installing the deployed version.
Cause
This happened for two reasons:
-
package.jsonwas labeled astype: "module", which required the use ofimportand explicitly disallows the use ofrequire(...) - I included an erroneous
defaultin the export ofClientanderrorsfromindex.js
Solution
- I removed the
defaultexport fromindex.js - I changed the package.json back to
type: "commonjs"- Updated imports that complained about this change
Prevention
- Updated eslint to disallow exporting
defaultinindex.jsto prevent this from happening again
Maintenance
- updated ESlint to 8.56.0