-
Notifications
You must be signed in to change notification settings - Fork 1
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
Three-Inspect does not work whether by ImportMap or Vite in plain ThreeJS project #21
Comments
Thanks for reporting! The vanilla export has been fixed in 0.5.0. Check out the docs for setup (which has changed) or this stackblitz example: https://stackblitz.com/edit/vitejs-vite-pxodhz?file=src%2Fmain.ts. Let me know if that fixes things for you. |
Thank you very much for responding, continuing to maintain the package, and for the tutorial for adding it. I really appreciate it. ThreeJS is very good it seems, but without an inspector it is hard to understand how hierarchies and objects are coming together or test changes. This goes a long way to helping with that. 1) NPM/Vite - WorkingI was able to install the 0.5.0 with NPM and My function was added from yours as:
2) Import Map - Not WorkingI see you have now also added the package here which is great: https://www.jsdelivr.com/package/npm/three-inspect But I am not able to make it work using that. Using the same code above but in LiveServer of Visual Studio Code (just running locally off import maps), I tried in my index.html:
But then I get
Is there any trick to making it work by import map or any fix that you can further offer? Having it work both ways makes the build and coding process much more versatile and easy to perform. Thanks again for your help. |
I am attempting to run Three-Inspect in a plain ThreeJS project (plain javascript).
Whether I try to load this by import map (eg. using LiveServer add-on in Visual Studio Code) or Vite it does not work.
Utilization
My simple code to try to use this in my project is:
Errors
However, this fails no matter how I try to get Three-Inspect running in my project.
1) Import Map
In my index.html I have:
However, while such an approach works well for other packages, on running the application in Visual Studio LiveServer, I get the error:
I am not sure what this represents, but it does not appear to work.
2) Using Vite
I have also tried installing it in Vite with both commands:
But when I run
npx vite
ornpx vite build
on the project, I get:A fix appears to be posted here for this identical error:
This is also posted as an error here:
A suggestion there as a workaround is:
But I am not sure where vite.config.js even is located on my system or whether this is the appropriate way this should be managed.
Based on the fix above, I presume we should not be getting this error.
Solution
Any help with either problem? Currently one cannot use Three-Inspect with any approach in a standard ThreeJS project based on both errors.
It looks like a great project and would be very helpful if working. I would greatly appreciate any further fix.
@michealparks as it appears you fixed this once before I'm wondering if you would be willing to take a look? Thanks for any help.
The text was updated successfully, but these errors were encountered: