Skip to content

2.7.1 breaks vitest config #120

@jtmueller

Description

@jtmueller

I have a project that uses vitest with happy-dom in conjunction with vite-plugin-solid. Switching from 2.7.0 of vite-plugin-solid to 2.7.1 breaks my unit tests.

Here's a relevant part of the test section of vite.config.mts:

  test: {
    environment: 'happy-dom',
    globals: true,
    server: {
      deps: {
        // fixes: You appear to have multiple instances of Solid. This can lead to unexpected behavior.
        inline: [/solid-js/, /solid-testing-library/],
      },
    },
    deps: {
      // fixes: Vitest "deps.registerNodeLoader" is deprecated. If you rely on aliases inside external packages, use "deps.optimizer.web.include" instead.
      optimizer: {
        web: {
          enabled: true,
        },
      },
    },

When I run vitest with vite-plugin-solid 2.7.0, everything works fine. When I run it with 2.7.1, I get:

 Vitest  "deps.registerNodeLoader" is deprecated.If you rely on aliases inside external packages, use "deps.optimizer.web.include" instead.
 MISSING DEP  Can not find dependency 'jsdom'

? Do you want to install jsdom? › (y/N)

The fact that it's not honoring either the environment: 'happy-dom' setting or the setting that suppresses the registerNodeLoader warning makes me think that something about 2.7.1 is preventing the test config from being loaded at all.

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