You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dfde469
Browse filesBrowse the repository at this point in the historyBrowse files
Note: `react-konva` is designed to work in the client-side. On the server side, it will render just empty div. So it doesn't make much sense to use react-konva for server-side rendering. In Next.js you may have issue like
170
170
171
171
> Module not found: Can't resolve 'canvas'
172
172
173
173
Why do we see this error? `canvas` module is used for canvas rendering in Node.JS environment. `konva` library will use it there, but it doesn't have this dependency explicitly.
174
174
175
-
#### Use dynamic loading
175
+
How to solver this issue? There are two approaches:
176
+
177
+
### Approach 1: manually install canvas module
178
+
179
+
You can install `canvas` module manually.
180
+
181
+
```bash
182
+
npm install canvas@next
183
+
```
184
+
185
+
The solution will solve the issue, but it will have unnecessary dependency on `canvas` module which may increase build time a little bit.
0 commit comments