Skip to content

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

Closed
@dmeehan1968

Description

@dmeehan1968

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions