This error only occurs when using the cached dependencies though. If I trigger a new build via the “Clear Cache and Deploy Site” button it will succeed.
What have you tried as far as troubleshooting goes? Do you have an idea what is causing the problem?
Found the note in the build-gotchas docs about not manually setting NODE_ENV=production, so removed that and got a build through. I’ve also tried updating my build environment to the latest one, but it only helped the first time (before there was a node_modules cache I assume).
I’m not sure why the cache is invalid, it almost seems like netlify is failing to properly cache the rollup-plugin-node-resolve module so when it uses the cache it’s just… missing. Is there a way to inspect the node_modules cache to verify?
Thanks. Is it installing that dev dependency in a separate directory other than your root node_modules? I ask because we only cache the single node_modules directory so any dependencies that live in other directories won’t be cached.
That’s… gross but workable I guess. Thanks for the help diagnosing this @futuregerald, I don’t think I ever noticed anything in the docs about the node_modules caching being only at the root so I likely would’ve never been able to track this down.