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

Imports broken since three.js update #47

Open
badde-media opened this issue Feb 11, 2022 · 7 comments
Open

Imports broken since three.js update #47

badde-media opened this issue Feb 11, 2022 · 7 comments

Comments

@badde-media
Copy link

Hi Lewy!

First of all, congrats to your great book, I love it. Especially the modular approach. Unfortunately, since the most recent three.js updates, your cdn imports don't work anymore. First of all, the version you've linked to cannot be found anymore. After changing that to the newest version (0.137.5 as of time writing), the next error shows up:
index.html:1 Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".
I assume that this is due to the newly introduced import mapping, which isn't represented in your source codes yet. Adding this snippet:

	<!-- Import maps polyfill -->
	<!-- Remove this when import maps will be widely supported -->
	<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>

	<script type="importmap">
		{
			"imports": {
								"three": "./vendor/three/build/three.module.js"
	               }
		}
	</script>

to the index.html file solved this issue, but now the next error states that there is an
Uncaught SyntaxError: The requested module '/-/three@v0.137.5-HJEdoVYPhjkiJWkt6XIa/dist=es2019,mode=raw/examples/jsm/controls/OrbitControls.js' does not provide an export named 'default'

Please be so kind and update your ressources, which I use as a starting point for all of my three.js projects now.

Best regards,
Daniel

@looeee
Copy link
Owner

looeee commented Mar 29, 2022

Hey Daniel, thanks for letting me know.
Sorry for the really late reply - I just realised I turned off notification for this repo by mistake 😅
I'll find some time this week to update this.

Glad you're finding the book useful!

@badde-media
Copy link
Author

One of the best resources I've found so far. Using it frequently. I've taken one of your projects and use it as a template for all my new projects. I'd love to see you expanding the book with an advanced section to cover topics like custom shaders, NURBS objects and more, three.js offers so much. In case you need help, just ask me. I'm still learning all this stuff by doing, but I think I'm already good enough to contribute to such a project.

@looeee
Copy link
Owner

looeee commented Mar 31, 2022

Thank you so much for the amazing feedback 😁

I'd love to see you expanding the book with an advanced section to cover topics like custom shaders

I don't have time to do large amounts of work on this myself anymore, unfortunately. But I have been hoping that other people would add stuff so I'd love for you to contribute something.

However please let me know before doing any large amounts of work - open up an issue here, or a discussion. We can work on the basic structure together and make sure it fits in with the rest of the book, or whether it would be better as a blog post or something else.

@looeee looeee reopened this Mar 31, 2022
@looeee
Copy link
Owner

looeee commented Mar 31, 2022

By the way I'll keep this issue open until I actually fix it. Otherwise I'll forget 😅

@badde-media
Copy link
Author

Sure :)

@Ian-McCleary
Copy link

Has this been fixed? I notice the issue is still persistent in the live version.

@looeee
Copy link
Owner

looeee commented Nov 29, 2022

Unfortunately not, and I have not had time to work on this at all.

I have not forgotten about it, it's just that real life has been getting in the way over the last few months 😅

I am open to PRs though if anyone else wants to have a go at fixing this.

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