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

🐛 [BUG] - Module not found: Error: Can't resolve '@primer/primitives' in '/usr/src/app/node_modules/@primer/react/lib-esm' #922

Closed
siqueirarenan opened this issue Apr 23, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@siqueirarenan
Copy link

Describe the bug

I'm suddenly having the following error message when building the app in production:

"Module not found: Error: Can't resolve '@primer/primitives' in '/usr/src/app/node_modules/@primer/react/lib-esm'"

It was working normally, and after a minor change it stoped working. I reverted the commit and it still does not work.

Reproduction steps

1- Environment:
Node version: 18.14.0
react: 18
@primer/octicons-react: ^17.11.1,
@primer/react: ^35.19.0

2- According to yarn.lock:
@primer/primitives@^7.11.11

3- Build with command:
react-scripts build

4- The app is being build in a Docker container running node:18-alpine

Expected behavior

Successful build.

Screenshots

No response

@siqueirarenan siqueirarenan added the bug Something isn't working label Apr 23, 2024
@lukasoppermann
Copy link
Contributor

Hey, this may be an issue to report to primer/react. But could you tell me the exact versions you are using?

Please run

npm list -depth=1

I get a different version:

+ @primer/react@35.32.2
│ ├── @github/combobox-nav@2.3.1
│ ├── @github/markdown-toolbar-element@2.2.3
│ ├── @github/paste-markdown@1.5.3
│ ├── @github/relative-time-element@4.4.0
│ ├── @lit-labs/react@1.2.1
│ ├── @oddbird/popover-polyfill@0.2.3
│ ├── @primer/behaviors@1.5.1
│ ├── @primer/octicons-react@19.9.0
+ │ ├── @primer/primitives@7.17.0

I assume you did rebuild your yarn.lock file?

@cbix
Copy link

cbix commented Apr 23, 2024

Not sure if it's related, but there seems to be an issue introduced in v7.17.0 likely by #874, the npm package doesn't include dist/js anymore and I'm getting these errors in my code:

error TS2307: Cannot find module '@primer/primitives' or its corresponding type declarations.

@lukasoppermann
Copy link
Contributor

Ahh, this helps. It is not this PR (this one is not merged yet) but probably something with the build process.

@lukasoppermann
Copy link
Contributor

I have a fix, will merge it soon.

@lukasoppermann
Copy link
Contributor

Fixed in v7.17.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants