-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble using pts on node server #132
Comments
Hi @stefa168 -- I'm not very familiar with node server, but I'm surprised that 'window' is referenced in the example you've given. I wonder if something like this would work ... import { Group, Pt, namespace } from "pts"
namespace( this );
let g = new Group(); Do you have a stack trace of your error message? If you have it, can you share it here? I'll try to find the bug. Thanks! |
Hi, thanks for the reply! I tried adding your suggestion, however the error remains.
|
Looks like it's related to this webpack setting: I'll experiment with the build and see if I can fix this -- hopefully in the next 1-2 weeks. Thanks for reporting this issue. Happy Holidays! |
Hi @stefa168 - This should be fixed v0.10. Please give it a try. We should be able to add support for node-canvas in future, but for now at least the static functions should work. |
Hi @williamngan, I just tried version 0.10.1 with a project of mine and it works without any issue! |
(two years later :) |
Basic node-canvas support is available. Take a look at: |
Hi, today I was working on some server-side TypeScript code that uses Group and Pt.
Unfortunately when I try to run my code, I get a
ReferenceError
sayingwindow is not defined
, which is understandable, since node doesn't have such thingsHere's a simple example that throws that exception:
Is there any way to use pts' classes on a node server, or am I out of luck?
Thanks!
The text was updated successfully, but these errors were encountered: