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

Can't resolve universal-cookie from within react-cookie #705

Closed
nflatley-zengenti opened this issue Oct 15, 2024 · 3 comments · Fixed by #706
Closed

Can't resolve universal-cookie from within react-cookie #705

nflatley-zengenti opened this issue Oct 15, 2024 · 3 comments · Fixed by #706

Comments

@nflatley-zengenti
Copy link
Contributor

I am working on a React project that is using webpack 4 and babel for transpiling to cjs and esm targets.

Since we upgraded our react-cookie and universal-cookies to v7 we cannot build our project.

 ERROR  Failed to compile with 1 errors                                                                          11:31:17

This dependency was not found:

* universal-cookie in ./node_modules/react-cookie/esm/index.mjs

To install it, you can run: npm install --save universal-cookie
× 「wdm」: 
ERROR in ./node_modules/react-cookie/esm/index.mjs
Module not found: Error: Can't resolve 'universal-cookie' in 'C:\dev\website\node_modules\react-cookie\esm'
 @ ./node_modules/react-cookie/esm/index.mjs 8:0-39 9:0-54 9:0-54 12:47-54 23:25-32

Tracing why this might be happening I noticed the "main" attribute in the universal-cookie package.json is missing

I added it back in into my local node_modules and now the project builds successfully

image

I can fork and PR to fix this if someone here is happy to review and release.

Many thanks
Neil

@nflatley-zengenti
Copy link
Contributor Author

@eXon
Copy link
Collaborator

eXon commented Oct 29, 2024

Fixed in 7.2.2

@nflatley-zengenti
Copy link
Contributor Author

I've updated to the new release and the problem is resolved. Thanks very much!

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 a pull request may close this issue.

2 participants