Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of namedPlaceholders config option causes dependency conflict in built Nuxt 3 app #1731

Closed
dmeehan1968 opened this issue Dec 6, 2022 · 2 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@dmeehan1968
Copy link

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 requires 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.

@sidorares
Copy link
Owner

named-placeholders hasn't been updated in 4+ years and issues appear to go unacknowledged so maybe its been abandoned.

I'm original author, happy to give the package some refresh, but encourage you to contribute as well ( migrate CI to github actions, enable dependabot action, add release-please etc )

@sidorares sidorares added the dependencies Pull requests that update a dependency file label Dec 7, 2022
@sidorares
Copy link
Owner

@dmeehan1968 v3.0.0 is released and now uses lru-cache 7.14.1 in its direct dependency and via named-placeholders, see mysqljs/named-placeholders#19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants