Skip to content

Lazy-load prettier when format is set to false #679

@ShoeBoom

Description

@ShoeBoom

Since prettier uses node specific modules i'm having issues running it in other runtime. Even if I turn off formatting with format: false, i still get noise in logs as following:

cloudflare workers:

[vitest-pool-workers] Failed to import "node:v8" from "/Users/shoeboom/Code/workspace/actions/node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/index.mjs". To resolve this, try 
bundling the relevant dependency with Vite. For more details, refer to https://developers.cloudflare.com/workers/testing/vitest-
integration/known-issues/#module-resolution

I'd like to propose:

  • lazy-load prettier only when format: true

Related issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions