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
I am running a React application, so I included the package using yarn add pixl-canvas-plus.
However, when I try to make an instance of the module using var canvasPlus = new CanvasPlus(), I get an error with the following message:
TypeError: process.hrtime is not a function
I believe this is because I am not running on Node.js, but instead running on Chrome.
There seems to be some dependencies that will only work with Node.js.
Any ideas on how to go around this issue? I tried out the demo, and really like it, so it would be awesome if I could actually get it to work in my application.
The text was updated successfully, but these errors were encountered:
Hello, and sorry for the confusion over this. The library is split into two separate modules: one for Node.js, and one for use in the browser / client. The browser / client library must be loaded differently:
So download the canvas-plus.js file from the provided URL, or pull it out of your module distribution that you got from npm, host it on your web server with your app, and load it in your browser using a standard SCRIPT tag:
<scriptsrc="canvas-plus.js"></script>
Please note that the client-side library is quite large (750K raw, 180K compressed), due to all the dependencies compiled into that one combo dist file.
I am running a React application, so I included the package using
yarn add pixl-canvas-plus
.However, when I try to make an instance of the module using
var canvasPlus = new CanvasPlus()
, I get an error with the following message:TypeError: process.hrtime is not a function
I believe this is because I am not running on Node.js, but instead running on Chrome.
There seems to be some dependencies that will only work with Node.js.
Any ideas on how to go around this issue? I tried out the demo, and really like it, so it would be awesome if I could actually get it to work in my application.
The text was updated successfully, but these errors were encountered: