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

Error: Loading PostCSS Plugin failed: Cannot find module 'caniuse-lite/data/features/mdn-css-backdrop-pseudo-element' #117

Closed
bsaoptima opened this issue Aug 17, 2023 · 9 comments

Comments

@bsaoptima
Copy link

I have a simple React Vite app with node version (v18.14.0) and npm version (9.3.1) that I am deploying on Heroku using git push heroku main.

For some reason, today I did some minor changes and when I pushed, this is the error that I was shown:

remote: [Failed to load PostCSS config: Failed to load PostCSS config (searchPath: /tmp/build_fb8634e4): [Error] Loading PostCSS Plugin failed: Cannot find module 'caniuse-lite/data/features/mdn-css-backdrop-pseudo-element'
remote: Error: Loading PostCSS Plugin failed: Cannot find module 'caniuse-lite/data/features/mdn-css-backdrop-pseudo-element'

Anyone aware of this?

@ai
Copy link
Member

ai commented Aug 17, 2023

You need to update caniuse-lite

Try npx update-browserslist-db@latest

@ai ai closed this as completed Aug 17, 2023
@bsaoptima
Copy link
Author

Hi thank you for such a quick reply, but this does not work I still have the same error. I noticed that when I deleted my postccs.config.js file it worked (no errors in push) but obviously the rendering was not there. Do you need any other information to solve this?

@ai
Copy link
Member

ai commented Aug 17, 2023

  1. What package manager do you use? pnpm, npm, yarn?
  2. Post somewhere your lock file and give me a link

@bsaoptima
Copy link
Author

  1. I am using npm!
  2. https://pastebin.com/HV4HJ653

Sorry for the delay I got dragged in a work event! Thank you for the help!

@ai
Copy link
Member

ai commented Aug 17, 2023

Everything looks good. Sorry, have no idea.

Maybe you have an issue with node_modules. Try to remove node_modules, npm cache clear --force and install dependencies again.

@bsaoptima
Copy link
Author

Still not working, I'm not even sure that is a fault on your side. It might be Heroku.

@ai
Copy link
Member

ai commented Aug 17, 2023

Maybe it is a problem in Heroku npm cache. Try to find a way to clean cache.

Also double check that you don’t have yarn.lock file.

But I checked that library itself work and it does. So very likely that it is a problem in your environment.

@bsaoptima
Copy link
Author

Yes I managed to solve it, it was about the way git tracked my node modules directory so yeah totally a problem in my environment. For people that encounter this issue: https://devcenter.heroku.com/articles/troubleshooting-node-deploys#don-t-check-in-generated-directories (this solved my issue).

Thank you very much for being so responsive, this is why our engineering communities are very good!

@yordis
Copy link

yordis commented Sep 3, 2023

In my case, I forgot that I had set resolutions at the root of the monorepo 🥲. Took me 5 mins to figure it out.

// maybe you did this!
"resolutions": {
    "caniuse-lite": "1.0.30001525"
  }

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

No branches or pull requests

3 participants