-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unable to resolve path to module 'universal-cookie' after update to 7.2.0 #624
Comments
Hey, I faced a similar issue here when trying to compile the project with react-cookie@7.2.0.
Upon checking the index.js file, it pointed to the error related to universal-cookie not being resolved correctly. Here’s the part of the code causing the issue:
Here's my package.json dependencies for reference:
I tried using ES module imports instead of require(), but ultimately, the issue was resolved when I downgraded to an older version of react-cookie. Specifically, I used react-cookie@6.1.1 while keeping universal-cookie@7.2.0. |
I suspect this issue is related to #705 |
Can you try with v7.2.2 and let me know if you have the same issue? |
@eXon v7.2.2 has resolved the issue for me. Edit: Actually, scratch that, with 7.2.2 I'm still getting issues with ESLint import/no-unresolved (https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md)
The file looks like: import Cookies from "universal-cookie";
export const cookies = new Cookies(); And using a relative path resolves it: import Cookies from "../../node_modules/universal-cookie";
export const cookies = new Cookies(); |
We have the same issue with v7.1.4` resolves correctly |
Our setup (base):
I have tried updating the import from
universal-cookie@7.1.4
touniversal-cookie@7.2.0
, when runningpnpm build
, I get the following error:web:build: ./src/components/navigation/language-switcher.tsx web:build: 5:21 Error: Unable to resolve path to module 'universal-cookie'. import/no-unresolved
When I downgrade back to
universal-cookie@7.1.4
and delete the.next
folder, the build works again. Do you maybe have an idea what needs to be done in that case? Thank you 🙏The text was updated successfully, but these errors were encountered: