Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The difference between 'compat-alias-package' and 'compat' package inside preact main repo #3745

Closed
1 task
ymchun opened this issue Sep 23, 2022 · 2 comments · Fixed by preactjs/compat-alias-package#8
Labels

Comments

@ymchun
Copy link

ymchun commented Sep 23, 2022

  • Check if updating to the latest Preact version resolves the issue

Background
We are developing a web component sdk using react-to-webcomponent. The sdk original use react & react-dom but we alias react using preact in our Vue application according to this doc.

Describe the bug
When aliasing react using the following alias in package.json

"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",

the error prompt out

Module not found: Error: Package path ./client is not exported from package [my project path]/node_modules/react-dom (see exports field in [my project path]/node_modules/react-dom/package.json)

it works when using the following alias

"react": "link:node_modules/preact/compat",
"react-dom": "link:node_modules/preact/compat",

Seems compat in main repo has client.js exported but none in compat-alias-package

@ymchun
Copy link
Author

ymchun commented Sep 23, 2022

added reproduce repo: https://github.com/ymchun/preact-reproduce

@developit
Copy link
Member

Thanks for the report! Just opened a PR with the fix.

thiagojedi added a commit to thiagojedi/compat-alias-package that referenced this issue Oct 4, 2022
So, there were a few issues with Node >17 and storybookjs (storybookjs/storybook#16623) that was causing errors on build, similarly to preactjs/preact#3745.

It was fixed in the same way by react: facebook/react#22954
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants