_hotkeysJs.default is not a function

Author: julianedenCreated Nov 22, 2025Updated Apr 6, 2026

When I literally copy and paste the first example in the docs, it just errors out. I changed F5 to k but that's all.

import hotkeys from 'hotkeys-js';

hotkeys('k', function(event, handler){
  event.preventDefault()
  alert('you pressed k!')
});

This just errors out with Uncaught TypeError: _hotkeysJs.default is not a function.

What am I missing here?