Open johansedgeware opened 5 years ago
Seeing a similar error when I try to use it with Vue. See #5
See my answer to #5 for a workaround.
@nagix you should really add an import 'roughjs'
to the main
and module
outputs of this lib (totally fine for the standalone umd
build to not reference roughjs at all).
issue is due to webpack trying to require the esm build of roughjs. To override it @nagix you will need to force specific commonJS build. You can do so by setting an alias or importing the canvas option directly when bundling(as it is your only used roughjs method anyway)
resolve: {
alias: {
'roughjs': path.resolve('./node_modules/roughjs/bundled/rough.cjs'),
}
}
@johansedgeware I have the exact same issue - did you solve this? The solution linked on #5 didn't work for me :(
The same problem with NextJs. Is there any way to solve it?
Hi,
I'm trying to use your library in a React environment. Can't push it up for reproduction but will try and do my best to explain what it is I am trying to do.
I got this component:
the data prop could look like this:
I've also installed all the dependencies (as far as I understood that I had to)
This is the error I'm getting