Stefan Stanković
Stefan Stanković

Reputation: 68

Puppeteer launch not working for no specific reason

Puppeteer launch not working for no specific reason. I'm completely confused because the same code works fine on basic node.js app. Even tho this is nest.js which i started learning this week, i'm still unable to find any workaround and solutions. Tried with headless true & false and also with -> args: ['--no-sandbox', '--disable-setuid-sandbox']. If anyone had similar experience, please tell. :/

code screenshot

Upvotes: 2

Views: 2215

Answers (1)

Ramaraja
Ramaraja

Reputation: 2626

You are importing it the wrong way.
Hence it gives you the type error,
Cannot read property "launch" of undefined
as puppeteer is undefined as you imported it in the wrong manner.

This should fix it,

import * as puppeteer from 'puppeteer';

Upvotes: 4

Related Questions