import ColorThief from './node_modules/colorthief/dist/color-thief.mjs'
This isn't a normal ES6 module, which should load automatically based on the module setting in package.json, eg import ColorThief from 'colorthief'.
It sounds like the instructions are a workaround for a badly set module value in package.json or an odd build process, but even playing with these I (and others, based on StackOverflow) can't get colorthief to work.
Per the docs:
This isn't a normal ES6 module, which should load automatically based on the
module
setting inpackage.json
, egimport ColorThief from 'colorthief'
.It sounds like the instructions are a workaround for a badly set
module
value inpackage.json
or an odd build process, but even playing with these I (and others, based on StackOverflow) can't get colorthief to work.When I follow the instructions: