-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
🐛 bug report
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project
adheres to. - I have searched the issue tracker for an issue that matches the one I want
to file, without success.
Description of the problem
Seeing an error in https://codesandbox.io/s/ancient-rgb-70b30 with the latest @primer/react version. This is specifically after a change that introduced subpath exports.
The library version works fine on stackblitz and on webpack powered builds in create-react-app and nextjs. I get the following error on codesandbox
ModuleNotFoundError: Could not find module in path: '@primer/react/lib-esm/Button' relative to '/node_modules/@primer/react/lib-esm/Dialog/Dialog.js'
In the above error the relative path ../Button
inside /node_modules/@primer/react/lib-esm/Dialog/Dialog.js
. During resolution, it becomes @primer/react/lib-esm/Button
when expected path should be node_modules/@primer/react/lib-esm/Button/index.js
.
Do you think it may have something to do with the new resolver changes introduced in #6148 ?
Here is the issue tracked in @primer/react
primer/react#1863
I reported the same bug under #6172.
How has this issue affected you? What are you trying to accomplish?
We are unable to use @primer/react library in any codesandbox.
To Reproduce
- Create a react codesandbox
- Import components from
@primer/react
. - Use in the codesandbox to see the error pop up.
Link to sandbox: link (optional)
Your Environment
Software | Name/Version |
---|---|
Сodesandbox | |
Browser | |
Operating System |