Skip to content
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

emscripten problems #207

Closed
extrawurst opened this issue Jun 26, 2021 · 3 comments
Closed

emscripten problems #207

extrawurst opened this issue Jun 26, 2021 · 3 comments

Comments

@extrawurst
Copy link
Contributor

I am using rapier inside a emscripten project:

cargo b --release --target wasm32-unknown-emscripten

unfortunately I am totally stuck why it panics in instant::wasm::now. as far as I understand the instant crate is intended to exactly solve this and allow using Instant::now() on Wasm targets - even emscripten.

exception thrown: TypeError: undefined has no properties,get/obj[prop]@http://localhost:8060/tmp_js_export.js:9:25308
instant::wasm::now::hc0282aa57e236f87@http://localhost:8060/tmp_js_export.js line 9 > WebAssembly.instantiate:wasm-function[2296]:0x53bdc
rapier2d::counters::timer::Timer::resume::he366f5707f00b84f@http://localhost:8060/tmp_js_export.js line 9 > WebAssembly.instantiate:wasm-function[10653]:0xc6a5f
rapier2d::pipeline::physics_pipeline::PhysicsPipeline::detect_collisions::h7b81d128e8328730@http://localhost:8060/tmp_js_export.js line 9 > WebAssembly.instantiate:wasm-function[10644]:0xc6227
rapier2d::pipeline::physics_pipeline::PhysicsPipeline::step::hefee14a6549ee715@http://localhost:8060/tmp_js_export.js line 9 > WebAssembly.instantiate:wasm-function[436]:0x127c5

any help would be appreciated

@extrawurst
Copy link
Contributor Author

turns out emscripten exposes no now but it exposes emscripten_get_now() so we have to fix this in instant: sebcrozet/instant#33

@APerricone
Copy link

sorry for bothering you, how did you import rapier on emscripten project? There is some tutorial or something?

@sebcrozet
Copy link
Member

Closing this issue since the fix in instant has been merged and published for a while now.
Please open a new issue in the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants