Comments (5)
Thanks for the issue! Haven't tried SparkAR myself, could you maybe share a minimal reproducible project with cannon-es? It will help with debugging.
That error is kinda weird, will check if it's something we added in cannon-es.
from cannon-es.
I've found the issue, you can't use npm modules directly from SparkAR, you have to add them as scripts:
For cannon-es specifically, you have to use the dist/cannon.cjs.js file, and import it as
import * as CANNON from './cannon-es'
I've made an example starter project with cannon-es
already installed:
cannon-es_working.arprojpkg.zip
from cannon-es.
Thanks a lot for your quick reply!
I attached a zipped "cannon-es_debuggingProject.arprojpkg", that's the packaged format for SparkAR-Studio projects. If you open it with SparkAR, it'll already do what this issue is about (on my system, anyway). If you want to play around with it, "save as" and it'll extract to a project directory where you point it to. That'll have the "scripts" subdir, where the .ts and the node_modules are etc.
The script is basically blank:
import D from 'Diagnostics';
import CANNON from 'cannon-es';
(async function () {
D.log("Init cannon-es_Hook");
const body = new CANNON.Body();
})();
It won't even print the log, as the error is thrown during compilation. With this empty-ish project, the line number is only "856".
I guess finding the (bundled?) JS that SparkAR is trying to compile could help in finding out more. If you yarn add cannon
and adjust the import, the log is printed to the SparkAR console. Let me know if you need anything else :)
cannon-es_debuggingProject.zip
from cannon-es.
@johannesrave did you ever sort this out? Seeing something similar in Studio, though I'm not using cannon.js
from cannon-es.
very cool, thank you @marcofugaro !
from cannon-es.
Related Issues (20)
- Orientation of a body HOT 1
- Chaining Hinges behaviour
- [ Question ] Spheres going through body with mass equal zero
- penetrate explosion
- The movement of a spinning ball in cannon js has an unexpected deviation that depends on the direction of the movement itself
- can anyone help me about using webpack to use it in one js file ?
- Documentation question: After getting the red box wireframe working, and want to get gray boxes bouncing...
- ConvexPolyhedron: Tetrahedron working vs. not working HOT 3
- DisableMotor() method does not work in HingeConstraint. HOT 1
- RaycastVehicle: We have twice call updateWheelTransformWorld in updateWheelTransform(from updateVehicle) and then in castRay
- How can I get a list of bodies touching the line between two vectors?
- getVelocityAtWorldPoint() requires result parameter, despite returning result HOT 1
- Documentation for vectorToWorldFrame() incorrect
- Unknown Force is applied on some vertically stacked cubes on straight plane? HOT 3
- What are indices parameters of CANNON.Trimesh function?
- I added a model, I don't know why there is no physical characteristics
- About the basic parameter units of RaycastVehicle in canon-es
- ConvexPolyhedron isn't working for certain vertices
- The sphere flies away after a few seconds while the tab is not active HOT 1
- Implementation of third person controller. How to prevent character from rotating when moving at an angle to an incline HOT 1
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 cannon-es.