-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Problem with paper.js in javascript strict mode #2049
Comments
If I modify paper.js src/style/Style.js to check if old is a string, I have no more error when using vite:
Can someone add this fix ? |
I'm seeing this too in Chrome:
The line in question is resetting the item style like so:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seem's I have the following error related to "use strict" javascript command.
Uncaught TypeError: can't assign to property "_canvasStyle" on "red": not an object
set paper-full.js:12491
set paper-full.js:12546
set strokeColor keypoints.js:448
addKeypoint keypoints.js:64
related source code is:
In my case "old" value is the string "red" defined by calling something like path.strokeColor = "red"
As it's a simple string, it doesn't have _canvasStyle property.
This is not a problem when "use strict" is not called, but seem's to be a problem when it's called.
I'm using vue3 with vite 4 as server in dev mode that probably activate strict mode by default. (I didn't had this problem with vue3-cli).
I'm not definitely sure the problem is caused by vite that is activating strict mode, but it"s seem's to be.
Is there any way to avoid the problem ? (vite configuration ? call path.strokeColor differently ?)
If it's really a problem, can you plan a code modification ?
Problem can be reproduced using the following code in firefox console:
remove 'use strict'; line and there is no error.
The text was updated successfully, but these errors were encountered: