-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use via import/require #4
Comments
Screenshot of console for reference: https://i.imgur.com/RL3hH1K.png |
You need to import Matter.js as the default export, not with a import Matter from 'matter-js';
import { MatterCollisionEvents } from 'matter-collision-events';
Matter.use(MatterCollisionEvents); |
Worked for me - thanks! |
Also worked for me, thank you. |
matyus
added a commit
to matyus/matter-collision-events
that referenced
this issue
Feb 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I've installed the plugin using: yarn add matter-collision-events.
Then I attempt to require/import the plugin, however Matter does not seem to recognize the plugin when imported.
I've tried the following:
import * as Matter from 'matter-js' import MatterCollision from 'matter-collision-events' Matter.use('matter-collision-events')
import * as Matter from 'matter-js' import MatterCollision from 'matter-collision-events' Matter.use(MatterCollision)
I've also tried importing as 'MatterCollisionEvents'.
I get the same error:
Let me know if I'm doing something wrong, thanks!
The text was updated successfully, but these errors were encountered: