Description
I've been using Nuxt 3 to implement a server api (REST) with mysql2 as the DB driver. This was working fine when in development mode, but when the Nuxt app is built (npx nuxt build
) and previewed (npm nuxt preview
), the use of named placeholders in a query will cause an exception, reporting that LRUCache requires the use of new
.
This stems from the named-placeholders
dependency, which require
s the LRUCache package, then treats the default export as a function when in later versions of LRUCache its a constructor.
Nuxt has a dependency on LRUCache 6, whereas named-placeholders has a dependency on 4.1.5.
It seems odd that the conflict only occurs in the built version, and was working ok in nuxt development mode (npx nuxt dev
).
named-placeholders
hasn't been updated in 4+ years and issues appear to go unacknowledged so maybe its been abandoned.