Comments (23)
+1
how do you fix this?
from react-game-kit.
Would it be an acceptable fix to do something like:
return typeof HTMLElement !== "undefined" && obj instanceof HTMLElement;
?
If so, we'd accept a PR for that!
/cc @kenwheeler
from react-game-kit.
@ryan-roemer I fixed it
from react-game-kit.
I changed that line but it came up with another error about performance in world.js, located in lib/native/components. Line 44 has the current time by performance.now()
, which brings an error. I changed it to d.getTime()
after doing var d = new Date();
from react-game-kit.
For the performance.now()
we could either document a required polyfill for usertiming or put guards around performance
-- any preference @kenwheeler ?
from react-game-kit.
Still facing this problem "ReferenceError: Can't find variable: HTMLElement"
any workaround for this? since matter-js already have a fix on this one
liabru/matter-js@18a0845
but i still have no luck on make this work.
from react-game-kit.
@notlose -- matter-js
needs to release a new version. It's just committed to master
and not actually published.
from react-game-kit.
@ryan-roemer thanks for reply. tried to update package.json inside react-game-kit with github repository url, still getting same result 🤔
from react-game-kit.
@notlose -- What's your full stack trace?
from react-game-kit.
@stefvhuynh -- Side note: This ticket may be blocked by upstream matter-js release. If so, Add [Blocked]
to the title and move to bottom of Backlog
. Thanks!
from react-game-kit.
[email protected] /Users/xxx/projects/TestApp
└─┬ [email protected]
└── [email protected] (git://github.com/liabru/matter-js.git#64be5a5e3ea3092c3318779966df6cd5a1d71e89)
thanks!
from react-game-kit.
So here's the problem -- they haven't updated build/*.js
:
https://github.com/liabru/matter-js/blob/64be5a5e3ea3092c3318779966df6cd5a1d71e89/package.json#L8
"main": "build/matter.js",
which leads us to: https://github.com/liabru/matter-js/blob/64be5a5e3ea3092c3318779966df6cd5a1d71e89/build/matter.js#L4384-L4392
/**
* Returns true if the object is a HTMLElement, otherwise false.
* @method isElement
* @param {object} obj
* @return {boolean} True if the object is a HTMLElement, otherwise false
*/
Common.isElement = function(obj) {
return obj instanceof HTMLElement;
};
I think you might need to go into node_modules/matter-js
and install dev dependencies and run something like:
$ gulp build:release
if I'm reading their scripts right.
... or we wait for them to publish 😛
from react-game-kit.
@notlose you have to go into node modules and change a few things. In node_modules/matter-js/build/matter.js, you need to change liabru/matter-js@63b02cf#diff-8af3a370948de7c6ae76591bfafe12d1R4391 to
return typeof HTMLElement !== "undefined" && obj instanceof
HTMLElement;`
and in world.js inside of react-game-kit/native/...world.js, you need to change the performance error that pulls up after fixing the first HTMLElement error. My earlier comment should help
from react-game-kit.
@ryan-roemer , @katzmannn thanks for advise! it works now combining you two's advise.
i have cloned matter-js from git and gulp build:release, and then fix the performance error by @katzmannn suggestion. thanks!
from react-game-kit.
Hello
I am starting react game kit
so i need your help.
I need simple code package for simple animation.
I will understand well about this example.
Thanks
from react-game-kit.
@kjin9174 -- Please only comment on issues that you are directly facing or can help out with. General purpose help is best sought out on Stack Overflow, or the existing "help me get started" issue you opened at #51. Thanks!
from react-game-kit.
thanks
from react-game-kit.
@Dantix, can you confirm that this issue is resolved with the release of [email protected]
? Our package.json
pulls in matter-js: ^0.13.0
, so you should be able to get 0.14.0
with a fresh npm i
.
from react-game-kit.
I don’t have a computer around but for 0.x.x will that actually match 0.14.0? I didn’t think it would
from react-game-kit.
ah, you are right, @ryan-roemer
from react-game-kit.
@ryan-roemer but you have a yarn.lock file in your repository, please upgrade matter-js there (version in lock file is 0.13). I've seen source of [email protected] and it has proper fix.
from react-game-kit.
Here is the PR to close this issue: #55
from react-game-kit.
Thanks @stefvhuynh
@kowalk -- The yarn.lock
file doesn't matter at all for consuming packages taking an npm dependency on react-game-kit
. In fact, it's not even published to the registry -- e.g., https://unpkg.com/[email protected]/
from react-game-kit.
Related Issues (20)
- Run into a problem with two or more sprites changing state simultaneously HOT 2
- Cannot read property 'subscribers' of undefined HOT 4
- Sprite Src Issue In RN HOT 2
- How can I remove the dependency on prop-types (as TypeScript provides type-safety already)?
- Replacing Loop div element with Fragment
- tilemap not updating when passed new array props
- Components should forward classNames HOT 1
- New context API HOT 1
- Keypress in demo fires twice for Firefox
- React Native: <Body><View> = Position disarray
- Sprite: switching repeat not working without changing state
- Does TileMap work with files like tiles.png
- Unit Test Mocks
- CRA 2.0 Issues
- How to create a component of falling shapes
- Current project status HOT 4
- Loop proptypes.object react-game-kit HOT 1
- Demo broken
- Archived? Whats the future on this? HOT 4
- Update build tooling infrastructure.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-game-kit.