Skip to content

[BUG] TypeScript compilation does not work #172

@Shamshiel

Description

@Shamshiel

Environment

  • chrome-aws-lambda Version: 5.3.1
  • puppeteer / puppeteer-core Version: 5.3.1
  • OS: Mac / Linux
  • Node.js Version: 12.18.3
  • Lambda / GCF Runtime: nodejs12.x

Description

I'm using chrome-aws-lambda in combination with TypeScript. I have chrome-aws-lambda and puppeteer-core installed.

Expected Behavior

If I use tsc my code compiles together with aws-chrome-lambda without errors.

Current Behavior

If I use tsc it throws the following error:

node_modules/chrome-aws-lambda/source/index.d.ts:1:115 - error TS2307: Cannot find module 'puppeteer' or its corresponding type declarations.

1 import { BrowserOptions, DirectNavigationOptions, ElementHandle, NavigationOptions, ResourceType, Response } from 'puppeteer';
                                                                                                                    ~~~~~~~~~~~
node_modules/chrome-aws-lambda/source/index.d.ts:201:41 - error TS2307: Cannot find module 'puppeteer' or its corresponding type declarations.

201   static get puppeteer(): typeof import('puppeteer');
                                            ~~~~~~~~~~~
node_modules/chrome-aws-lambda/source/index.d.ts:211:36 - error TS2304: Cannot find name 'BrowserContext'.

211   export interface Browser extends BrowserContext {
                                       ~~~~~~~~~~~~~~
node_modules/chrome-aws-lambda/source/index.d.ts:218:16 - error TS2304: Cannot find name 'Target'.

218     targets(): Target[];
                   ~~~~~~

Steps to Reproduce

Currently I have no easy steps for reproduction of the issue. I will try to come up with one.

Possible Solution

Currently I can only compile my code with tsc if I add "skipLibCheck": true to my tsconfig.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions