Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Cannot find module 'puppeteer' from 'puppet-scraper.cjs.development.js' #11

@moltar

Description

@moltar

Getting the following errors in Jest when trying to use the module:

    Cannot find module 'puppeteer' from 'puppet-scraper.cjs.development.js'

    Require stack:
      node_modules/puppet-scraper/dist/puppet-scraper.cjs.development.js
      node_modules/puppet-scraper/dist/index.js
      src/puppeteer.ts
      src/puppeteer.test.ts

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:299:11)
      at Object.<anonymous> (node_modules/puppet-scraper/dist/puppet-scraper.cjs.development.js:8:33)

I think it is probably this line:

import Puppeteer, { Page } from 'puppeteer';

It assumes one has puppeteer installed, but in reality it is also possible to use only puppeteer-core.

I think, in fact, it would be the preferred way for a library to use the -core version, as it wouldn't pull in Chromium by default.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions