Skip to content

Use "NODE_ENV" instead of "npm_lifecycle_event" to check whether to initiate prisma studio #96

@joshsedl

Description

@joshsedl

Currently, in

nuxt-prisma/src/module.ts

Lines 192 to 195 in 55451aa

if (!options.installStudio || npmLifecycleEvent !== "dev") {
consola.info(PREDEFINED_LOG_MESSAGES.skipInstallingPrismaStudio);
return;
}
, we do an early return, when "npm_lifecycle_event" is not "dev".

"npm_lifecycle_event" is only "dev" if the nuxt dev server is started through a package.json script in the form of:

"dev": "nuxt dev"

When manually running npx nuxt dev, prisma studio is never initialized, this is quite confusing IMO.

Wouldn't it make more sense to simply check whether NODE_ENV is set to "development"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions