Why does Wappler keep removing mysql2 package?

Hi.
I don't have a MySQL DB to add to my Wappler project, but I provide a function where user may add DB credentials in the app - to connect to their PgSQL or MySQL DB.
For this, I have a custom extension, which has defined mysql2 package in "usedModules".
And also in the config/modules.js file, I can see mysql2 mentioned as dependency.

But, every time I switch to the project, or restart Wappler, this package gets removed from package.json.
I found this post - Node package gets deleted from package.json on wappler restart - which implies that a potential solution is to create a MySQL DB connection in Globals. But, since I don't have a MySQL DB to connect to, it does not apply, and the solution is weird to begin with.

Not sure if this is a bug, so have kept it under need help. Please help.

Hi Sid,

Normally indeed we cleanup the unused database packages when not used as global database connections.

We should however respect the usedModules in custom extensions - but also only when the custom extension action is really used in the project.

Are you sure this is the case? So not only the extension installed but also really added as action in a server connect file.

Yes, without that, package does not get added to the usedModules file.