Skip to content

1.8.4

Choose a tag to compare

@github-actions github-actions released this 13 Dec 21:40
· 52 commits to master since this release

This is a fix for the issue pong posted in our Mattermost chat:

Error loading model[/app/node_modules/@digiserve/ab-utils/shared/models][User.js]:
:: Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/nanoid/index.js from /app/node_modules/@digiserve/ab-utils/shared/models/User.js not supported.
Instead change the require of index.js in /app/node_modules/@digiserve/ab-utils/shared/models/User.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/app/node_modules/@digiserve/ab-utils/shared/models/User.js:6:16)
    at /app/node_modules/@digiserve/ab-utils/utils/controller.js:148:34
    at Array.forEach (<anonymous>)
    at includeModels (/app/node_modules/@digiserve/ab-utils/utils/controller.js:145:30)
    at new ABServiceController (/app/node_modules/@digiserve/ab-utils/utils/controller.js:163:7)
    at Object.controller (/app/node_modules/@digiserve/ab-utils/utils/controller.js:741:11)
    at Object.<anonymous> (/app/app.js:21:21) {
  code: 'ERR_REQUIRE_ESM'
}

It seems like the appbuilder service upgraded nanoid to v5.xxx which doesn't like how we were requiring it in ab-utils. All the other services are still on v3.xxx.

However, the offending code is in the shared/models directory, and those shared models were depreciated long ago. I don't think we use them anywhere in favor of just getting our models from the AB.objectUser() and such.

So I'm just going to remove these shared models and the code that would try to load them.

Release Notes

  • [fix] remove depreciated shared Models

Test Status

Our existing tests should be sufficient to make sure things still operate as expected.