Fresh install of feathers via cli. (JS, postgres, typebox, etc.)
Create migration via npm run migrate:make
Run migration npm run migrate
Expected behavior
Template for knex migration should match the ES modules style generated by the CLI.
Actual behavior
Error is thrown:
exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '.../api/protoFJ/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '.../api/protoFJ/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file://.../api/protoFJ/migrations/20240229202710_users.js:5:1
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:431:15)
at async .../api/protoFJ/node_modules/knex/lib/migrations/migrate/Migrator.js:86:15
at async Promise.all (index 0)
at async Migrator.latest (.../api/protoFJ/node_modules/knex/lib/migrations/migrate/Migrator.js:83:9)
at async Command.<anonymous> (.../api/protoFJ/node_modules/knex/bin/cli.js:250:32)
Steps to reproduce
npm run migrate:make
npm run migrate
Expected behavior
Template for knex migration should match the ES modules style generated by the CLI.
Actual behavior
Error is thrown:
Current template output with knex
Should likely be
System configuration
Module versions Feathers: 5.0.23 Knex: 3.1.0
NodeJS version: v20
Operating System: OSX