Tom's Two-up Two-down

Letterbox


Build Command - Nil Points!

I forgot to update the Netlify build command on my latest project, monkeyCatRobot. I installed and configured Rollup to bundle my code, and everything worked fine locally. But there was an error when I deployed to Netlify's CDN. I spent a good bit of time rummaging around the interweb with no luck, and I drafted a question, which I almost posted to Stack Overflow. Then I remembered I had made the same mistake on my last project. Fool meself once... The correct build command: rollup -c && eleventy. Nil points.

Here is the question I nearly posted to Stack Overflow:


Title

Browsers block bundle.js from loading

Summary

Browsers are loading my bundled JavaScript locally (localhost:8080), but when I deploy, browsers block bundle.js from loading on the website. Here are the errors:

  • Firefox: Loading module from “https://www.monkeycatrobot.com/assets/js/bundle.js” was blocked because of a disallowed MIME type (“text/html”)
  • Chrome: Failed to load resource: the server responded with a status of 404 ()

I'm using Rollup to bundle my JavaScript to dist/assets/js/bundle.js, and this is the script tag I'm using in dist/index.html: <script type="module" src="/assets/js/bundle.js"></script>.

My code is on GitHub. I set this project up the same way as I did my personal website (GitHub repo), which works fine (no errors). I'm out of ideas.

What I've Tried

Reading through similar questions on this forum, I see no answers that apply. My Duck Duck Googles return nil points. I've considered screaming a rude word while typing really hard on my keyboard.


But I did not post the question.

The end.

PS: "Fool meself once" is a good project name.