I'm attempting to import a module in vanilla JS in the browser (no bundler).
The module is worker-timers (https://github.com/chrisguttandin/worker-timers), which I installed into the same directory as my index.html via npm install.
But I get multiple 404 errors, like GET http://127.0.0.1:3000/node_modules/worker-timers/build/es2019/factories/load-worker-timers net::ERR_ABORTED 404 (Not Found)
My minimal code is below.
<body>
<script type="importmap">
{ "imports": {
"worker-timers": "./node_modules/worker-timers/build/es2019/module.js",
"worker-timers-broker": "./node_modules/worker-timers-broker/build/es2019/module.js",
"worker-timers-worker": "./node_modules/worker-timers-worker/build/es2019/module.js"
} }
</script>
<script type="module">
import * as workerTimers from 'worker-timers';
console.log(workerTimers);
</script>
</body>
What am I doing wrong?
Or, I'm happy to import them any way that works, if there's an alternative.