Skip to content

Configure module resolution condition in developement mode #1930

Open
@garronej

Description

Description

Hello Vike team,

First of all, congratulations on what you’re building!

I wanted to bring to your attention a potential issue with the Vike development server configuration, which could lead to a "dual package" scenario during development. By "dual package," I mean instances where different distributions of the same module are loaded simultaneously. This can cause problems, particularly for modules that are used as peer dependencies, such as those exposing a React context provider.

To help illustrate the issue, I’ve created a reproduction repository:
https://github.com/garronej/vike-dual-package-repo-repo

As per @Andarist's analysis, this issue could potentially be resolved on your side by passing the --conditions=development flag to Node.js. You can review his explanation here.

This issue is currently affecting users implementing tss-react in Vike, and likely other modules that rely on @emotion/react as a peer dependency.

Thanks a lot for taking the time to review this!

Best,

References:

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions