question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error "Cannot read property 'y' of undefined" in the file ShapePath.js

See original GitHub issue

If in the file Font.js in the function createPath value glyph.o ends with text "m {number} {number} z " (e.g. "m 167 878 z ") then in the file ShapePath.js in the function isPointInsidePolygon occurs this error: image image

This happens, for example, when I use character “Ö” of font Calibri.

In the file ShapePath.js in the function toShapes this code:

} else {

	newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );

should be changed to this code:

} else if ( tmpPoints.length ) {

	newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Mugen87commented, Sep 21, 2020

Closing for now. The issue can be reopened if it’s proven that facetype.js works as intended.

1reaction
blizzard-mindfloatcommented, Sep 16, 2020

The JSON file used in jsfiddle was generated using generator http://gero3.github.io/facetype.js/ and using TTF file downloaded from https://www.fontmirror.com/calibri.

I have replaced all texts "m {number} {number} z " with text "z" and now there is no error and the character “Ö” seems to be fine: https://jsfiddle.net/blizzard_mindfloat/6smn8heb/2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
ERROR Cannot read properties of undefined PATH
From the error message: "message": "Cannot read properties of undefined (reading 'path')". -> Somewhere in the code, we read the property ...
Read more >
Uncaught TypeError : Cannot read properties of undefined
Looking for ways to handle Uncaught TypeError: Cannot read property of undefined in JavaScript? This guide will help you to catch errors.
Read more >
Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >
TypeError: "x" is (not) "y" - JavaScript - MDN Web Docs - Mozilla
Oftentimes, unexpected undefined or null values. Message. TypeError: Cannot read properties of undefined (reading 'x') (V8-based) TypeError: "x" is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found