Skip to content

Conversation

@vzaidman
Copy link

@vzaidman vzaidman commented Dec 28, 2024

fixes #9.

The latest versions of Node.js force rollup-plugin-react-refresh to require react-refresh via a relative import.
See https://nodejs.org/api/packages.html#main-entry-point-export for more details.

This PR allows passing a relative import path as a plugin's option, reactRefreshRuntimeFilePathRelativeToPlugin, and sets it to be a default that would work for most of the people:

- 'react-refresh/cjs/react-refresh-runtime.development.js'
+ const DEFAULT_REACT_REFRESH_PATH = '../react-refresh/cjs/react-refresh-runtime.development.js';

It also updates the readme, and adds an error in case there's a problem to resolve react-refresh-runtime.development.js.

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.

Package fails in last nodejs versions with ERR_PACKAGE_PATH_NOT_EXPORTED

1 participant