Skip to content

import issue with typescript and npm install #30

@ajur

Description

@ajur

Hi,

tl;dr I believe there should be @types/phaser-box2d package?

So, I'm playing with phaser-box2d with non-phaser project.
As for most my recent projects, I'm using TypeScript (with vite template).
And as I don't like coping libs into my sources, i prefer libs intalled with npm.

And here is the issue, when I just install npm i phaser-box2d (as suggested in readme!), and than try to import something, e.g.:

import { b2CreateWorld, b2DefaultWorldDef, b2Vec2 } from "phaser-box2d";

VSCode complains on import, that it cannot find the "phaser-box2d" module.

Interestingly enough, installing directly from gh npm i github:phaserjs/phaser-box2d works without issues.

If there is something that I'm missing and/or doing wrong, maybe adding some additional section for TypeScript support with npm install to README would be good idea?

Cheers! And thanks for fantastic work on this! :)

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