Skip to content

How do I import when using Typescript? #270

@smeriwether

Description

@smeriwether

Hi 👋,

I'm trying to import Scout into a Typescript project, but I'm running into an issue. I'm quite new to Typescript so I imagine it's a small mistake that I can't see.

Here's my code:

import * as Scout from "@scout_apm/scout-apm"

And here's the error:

./server/middlewares/scout.ts:3:24
Type error: Could not find a declaration file for module '@scout_apm/scout-apm'. '{hidden}/node_modules/@scout_apm/scout-apm/dist/lib/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/scout_apm__scout-apm` if it exists or add a new declaration (.d.ts) file containing `declare module '@scout_apm/scout-apm';`

Any help would be much appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions