node-vibrant: this.WorkerClass is not a constructor
Hi, I am getting this error with the example from the docs:
in promise) TypeError: this.WorkerClass is not a constructor.
This is my code:
console.log(src); Vibrant.from(src).getPalette() .then((palette) => console.log(palette))
I am using React.
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 33
- Comments: 23 (4 by maintainers)
@ivgtr Your solution worked perfectly to resolve this issue!
Currently, npmjs has an alpha version distributed as a latest version. In my case(use Nuxt.js), I downgraded from “3.2.1-alpha.1” to “3.1.6”, and the error was solved.
I’ll do my best to take a look at how we can ship down a built version of this that doesn’t require webpack. Timeline is hesitant, as I have some family health problems, so please be patient 😃
thank you!!!
Sorry for the confusion. We are still finalizing the docs.
You will need webpack and worker-loader for this to work. Relevant docs are in the develop branch: https://github.com/akfish/node-vibrant/tree/develop#webpack-configuration
@Lucienest you’re welcome to open a PR to fix this.
It’s been two years, you guys still couldn’t fix it??
Still having the same problem with Vue3, Nuxt3, node-vibrant@3.1.6 and worker-loader@3.0.8…
Unless that error is directly connected to this issue (which I don’t believe it is), you’ll need to create a separate issue for that.
Same problem, using Vue.js 3 with Vite
Work fine with
node-vibrant@3.1.6