#TypeScript Tutorial - Local Machine

4 messages · Page 1 of 1 (latest)

rocky mica
#

Hi all,

This is likely a very noob question but I can't seem to figure it out! I am trying to follow the TypeScript tutorial on my local machine, but I am getting two errors in my console:

  1. 127.0.0.1/:16 GET http://127.0.0.1:5500/index.pack.js net::ERR_ABORTED 404 (Not Found)
  2. Refused to execute script from 'http://127.0.0.1:5500/index.pack.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Upon researching the 'index.pack.js' file, I have not found anything to solve the issue. Any support would be greatly appreciated!

civic coral
#

Did you download a working Scrim as a .zip and then try to run it locally?

If so and if memory serves that's the way Scrimba internally references your code - it's using some packager (Vite maybe?) and processing your index.ts into index.pack.js but likely in your .html you're trying to load "index.js" (or maybe vice-versa...)

If that's the case just make sure that your <script> in your .html file matches the filename of your compiled .js file (NOT your .ts file)

rocky mica
civic coral
#

can you post some code so I can check it out? A GitHub repo would be ideal but at least something relevant here would be helpful...