Sunday, March 18, 2018

Runtime Error: Cannot find module 'foobar.d.ts' from Typescript

Continuing on with the theme of me using my illustrious blog as a dumping ground:

This runtime error puzzled me. It compiled cleanly in Typescript, but at runtime raised an error. It shouldn't have even been compiled in the first place. So what's the deal?

`Error: Cannot find module '../../../typings/foobar'`

Well, the deal is pretty simple. The typing file contained an enum data structure. Since those get converted to actual code, that meant that the compiler emitted a 'require' statement for the type definition file, which meant that Node tried to load it... can't load a d.ts file at runtime, can you?

Wednesday, February 07, 2018

"Something seriously went wrong: Invalid Parameter" for XPS 13 9360?

I just had a simple Ubuntu update soft-brick an entire laptop. My less-than-two-years-old XPS 13 9360, to be exact.

The error message was,

Something seriously went wrong: Invalid Parameter
Shim was unable to measure state into TPM

Ironically I had spent the ten minutes earlier ranting to myself about how much I hated having to use macOS.

Here's how I recovered the system.

You'll need:


  1. A USB stick, formatted as FAT32

Either go here or google "XPS 13 9360 bios update". 

Scan the list of downloads for an entry that says "System BIOS" (you may have to click "View More" to see the entire list). Download it. The version I got was 2.4.2, but your mileage may vary. You'll only find an .exe file to download: that's fine. Take it and put it on your USB stick.

Plug the USB stick into the affected laptop. 

Restart the laptop, and jam F12 as frantically as possible. Eventually you'll go into the bios boot menu. Uses the cursor keys to highlight the "Bios UPGRADE" entry, then press ENTER on your keyboard.

Click the "..." button on the next page, and then click the empty dropdown. You'll see entries like "F1, F2, F3", etc. Go through them all until you find the .exe you downloaded earlier. Select it, and press the open button near the bottom of the dialog.

Wait a second. If everything went correctly, the system will recognize the .exe file as a bios update. Press the "install" button, then sit back and relax. Maybe keep your animals away from the laptop, because this isn't something you'll want them to interrupt with their big stupid cat feet.

The computer will automatically reboot. If all went well, you'll be staring at your login screen again. If you sign in and are just staring at your default wallpaper, without a GUI in sight, do this:

  1. CTRL+ALT+F2
  2. Log in with your username (I hope you remember that), then type in the following commands minus the quotation marks
  3. "sudo apt-get update"
  4. "sudo apt-get upgrade" (this will not upgrade your distribution to Ubuntu x.x, it'll just grab whatever new updates there are for your current distribution. If all that sounded greek to you, don't worry about it.)
  5. "sudo shutdown -r now"
Your computer should reboot after that last command. Now, when you log in, you should be staring at your old trusty desktop... I hope. If it's still broken, then I can't help you, but Dell probably can. Your service tag is under your laptop. Good luck, my friend.