In my Firebase cloud function using the puppeteer-extra package with a stealth plugin, I encountered a ‘missing puppeteer’ error despite the module being installed. Switching to puppeteer led to deployment issues. What might be causing this?
I encountered a similar issue when working with Firebase Cloud Functions. In my case, it turned out that the packaging process omitted some dependencies because they were dynamically required by the module. After some investigation, I learned that the build process sometimes fails to account for these untargeted dependencies, especially when modules like puppeteer-extra are involved. Eventually, I modified the import strategy and explicitly referenced the modules. This ensured that everything was included during deployment. A proper cleanup of the build cache and a full redeployment also helped to clear up any lingering dependency issues.