TypeError without scripts or assets

Can someone explain me why this project is having TypeErrors when there are no scripts etc in it?

All it has is one polygon and an ellipse…

This is what console gives upon run:

Screenshot 2020-03-11 at 17.39.21

Project: hypeIssue.hypetemplate.zip (9.0 KB)

Weirdly, if you duplicate the ellipse, errors double. But if you delete either the polygon or the ellipse, errors disappear…

The runtime is a great hunk of code so… maybe you didn’t add code but there is clearly some bug. Interesting find. If I create an ellipse and a polygon in a fresh document I can’t reproduce. But running from your template… I can.

1 Like

Seams like the runtime can’t resolve the svgPathElement (svgPathElementForElement in updateVectorShapePathProperties) it wants to apply initial values to… @jonathan.

1 Like

Thanks for this report.

This is a bug, though aside from the erroneous logging is essentially harmless. It arrises when a non-vector shape tries to assign vector shape properties. The most likely cause of this that I found is if you did a ‘Convert to Vector Shape’ and then performed an undo. There’s probably a few other causes I can theoretically think of that will need to be protected against.

(The reason it does not show up if you only have the ellipse is that it will not use the full runtime version which contains the vector shape code, where the error occurs)

It has been filed to be addressed in a future version. Sorry and thanks again!

1 Like

Yep, this is exactly what I did. I just did a test with a fresh document and managed to reproduce it:

  1. Create a vector shape (i.e. Polygon)
  2. Create a non-vector shape (i.e. Ellipse)
  3. Right-click the non-vector shape and select 'Convert to Vector Shape'
  4. Undo
  5. Preview project -> Console displays errors

No worries and thanks!


P.s. interestingly, when you try to convert the undoed/'infected' previously-vector-shape to vector again via 'Convert to Vector Shape', a dialog asking for confirmation to remove Inner HTML content pops up:

Screenshot 2020-03-12 at 09.25.24

I can see in the data.plist that the ellipse now contains InnerHTML without anything inside:

					<dict>
						<key>identifier</key>
						<string>InnerHTML</string>
					</dict>

p.p.s. because I like digging and because of .. reasons: removing these items from data.plist got rid of the TypeErrors (removing any bezier items from the shape):

					<dict>
						<key>identifier</key>
						<string>BezierPathStrokeColor</string>
						<key>objectValue</key>
						<string>#000</string>
					</dict>
					<dict>
						<key>identifier</key>
						<string>BezierPathStrokeWidth</string>
						<key>objectValue</key>
						<string>0px</string>
					</dict>
					<dict>
						<key>identifier</key>
						<string>BezierPath</string>
					</dict>
1 Like

Yes, those are the exact repro steps I found!

Perhaps a bit of "inside baseball"... how properties get cleared out when not used is an area that isn't super clean within the codebase and leads to situations like this. The assumption starting out was that all elements would just have all properties, but as various element types were added (including items like groups), this became very untrue.

Nice hack to resolve it! :slight_smile:

Of course I should mention hand-editing the data.plist is unsupported and could lead to problems :wink:, though in this case should be okay.