Problems with using puppeteer in custom strapi plugin

System Information
  • Strapi Version: 4.1.3
  • Operating System: Windows 10
  • Database:
  • Node Version: 16.13.2
  • NPM Version:
  • Yarn Version: 1.22.5

Hi everyone,

I started developing my own custom plugin for v4. Idea is to pass it a url that puppeteer would scrape and import as a content. But when trying to run strapi build to build the plugin, I am getting a bunch of dependency problems tied with puppeter.

ModuleNotFoundError: Module not found: Error: Can’t resolve ‘fs’

Field ‘browser’ doesn’t contain a valid alias configuration

After a bit of digging in, I found that I should create something like this in root of package.json file:

  "browser": {
    "fs": false
}

This, unfortunately, does nothing. I can not get rid of these errors.

1 Like