Skip to content

Conversation

@Iron-56
Copy link
Contributor

@Iron-56 Iron-56 commented Nov 19, 2025

Fixes #1031

Changes

  • Removed react and react-dom override

PR Checklist

Problem

Running npm install fails with the following error:

The npm:@preact/compat@latest syntax in the overrides section of package.json causes compatibility issues, preventing contributors from installing dependencies.

Solution

The Preact alias overrides are actually redundant. The Astro Preact integration automatically handles react compatibility using compat: true option of astro.config.mjs:

preact({
  compat: true,  // aliases react
}),

@Iron-56
Copy link
Contributor Author

Iron-56 commented Nov 20, 2025

Can you look onto this PR @ksen0 ? I am not sure if its the correct branch to merge to. Thank you!

@limzykenneth
Copy link
Member

limzykenneth commented Nov 25, 2025

I'm not 100% sure this is redundant/no needed. The override is specifically for using react component libraries (such as @uiw/react-codemirror) with preact, as described here: https://docs.astro.build/en/guides/integrations-guide/preact/#compat

When importing React component libraries, in order to swap out the react and react-dom dependencies as preact/compat, you can use overrides to do so.

Is that not the case?

@Iron-56
Copy link
Contributor Author

Iron-56 commented Nov 27, 2025

Yeah it was my npm's issue, I recently updated and it's fixed.

@Iron-56 Iron-56 closed this Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm install/ci fails with an error

2 participants