mikewesthad / phaser-matter-collision-plugin

A plugin for making it easier to manage collisions with Phaser 3 + Matter.js
MIT License
99 stars 8 forks source link

Error with Typescipt & Parcel #8

Closed mikewesthad closed 2 years ago

mikewesthad commented 2 years ago

From @MEJSIK in issue #3:

Bit of a delay, but the typescript version is live as of v1.0.0

Yeah, but I have problem with importing the plugin. I got this error: image

I'm using Parcel and Typescript

mikewesthad commented 2 years ago

Weird, if I import from:

import PhaserMatterCollisionPlugin from "phaser-matter-collision-plugin/src/index";

It works fine. Seems like Parcel is having trouble parsing the bundled JS for some reason.

mikewesthad commented 2 years ago

Hm, and it works fine with:

import PhaserMatterCollisionPlugin from "phaser-matter-collision-plugin";

If I configure parcel to not use source maps:

parcel src/index.html --no-source-maps
mikewesthad commented 2 years ago

Well, this looks like an issue in Parcel itself,

mikewesthad commented 2 years ago

What a headache... Closing this issue, there are two options:

mikewesthad commented 2 years ago

For reference, updated this codesandbox to demo how to use Parcel 2