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

MIME type ('application/octet-stream') is not executable #45

Closed
olgageletina opened this issue Jan 19, 2022 · 6 comments
Closed

MIME type ('application/octet-stream') is not executable #45

olgageletina opened this issue Jan 19, 2022 · 6 comments

Comments

@olgageletina
Copy link

olgageletina commented Jan 19, 2022

Hi there,

Thanks for putting this awesome resource out there. I was hoping to use the 3.0.1 version in codepen but getting a MIME type ('application/octet-stream'). Here's the link. Version 2.4.0 seems to work fine, given a nearly identical implementation.

@jwagner
Copy link
Owner

jwagner commented Jan 19, 2022

Hey @olgageletina , Thanks for sharing this issue. The first link does not work for me 'This debug view expired.'. Can you update it? Should be able to have a look at this later today. :)

@olgageletina
Copy link
Author

Thank you @jwagner!! Apologies, here's the link and the full error I'm getting.

@jwagner
Copy link
Owner

jwagner commented Jan 19, 2022

No worries @olgageletina . The issue doesn't seem to be with simplex-noise.js itself but rather with the config in cdnjs. Specifically this file here: https://github.com/cdnjs/packages/blob/master/packages/s/simplex-noise.json

Since simplex-noise 3 is now a module the best way to use it is to import it. I've updated the example pen to reflect this:
https://codepen.io/jwagner/pen/BNmpdm

Looking at it now it would probably be a good idea to add a few more nicer demos than this simple plasma effect as well. :)

Would be awesome if you can confirm that using the import is working for you.

@olgageletina
Copy link
Author

Sweet, thank you @jwagner! For some reason when I import the simplex module it prevents P5 from loading. There are no errors in the console. In fact unless I remove the import statement completely (commenting it out doesn't work) P5 doesn't render. When I try to import P5 it throws an error.

I filed an issue with codepen to see if it's on their side. The pen is for a class where most of the students are new to JS. So I was hoping to avoid the canvas scripting API for now.

@jwagner
Copy link
Owner

jwagner commented Jan 20, 2022

@olgageletina with the import statement your script runs in a module. This results in the setup function not being globally visible. A simple window.setup = setup; at the end of your script should resolve your issue. :)

@olgageletina
Copy link
Author

Got it — appreciate your help!

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

2 participants