If the model extension is .js and a esm module uses express-cassandra you get the following error in node v14.19.3:
require() of FooModel.js from /home/face/proj/test/test-api/node_modules/express-cassandra/lib/expressCassandra.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename CommentsModel.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/face/proj/test/test-api/package.json.
This adds .cjs to the file filter so express-cassandra can then use require() on your models using the .cjs file extension.
If the model extension is
.js
and a esm module uses express-cassandra you get the following error in node v14.19.3:This adds
.cjs
to the file filter so express-cassandra can then userequire()
on your models using the.cjs
file extension.