TypeError is thrown when layout.scripts is null in 0.6.9
See original GitHub issueTypeError: Cannot read property ‘length’ of undefined
at Object.Layout.getDefaultScriptName
(.../node_modules/opentype.js/src/layout.js:111:43)
at Font.stringToGlyphs
(.../node_modules/opentype.js/src/font.js:155:58)
/**
* Returns the best bet for a script name.
* Returns 'DFLT' if it exists.
* If not, returns 'latn' if it exists.
* If neither exist, returns undefined.
*/
getDefaultScriptName: function() {
var layout = this.getTable();
if (!layout) { return; }
var hasLatn = false;
for (var i = 0; i < layout.scripts.length; i++) {
var name = layout.scripts[i].tag;
if (name === 'DFLT') return name;
if (name === 'latn') hasLatn = true;
}
if (hasLatn) return 'latn';
},
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
JavaScript TypeError: Cannot read property 'style' of null
It sounds like the <div> Noite does not exist when you're calling this script. Try moving the javascript to the body of your...
Read more >uncaught typeerror cannot set properties of null ... - You.com
I am just learning java script so I am pretty new at it. I have been trying to debug it for at-least 1...
Read more >Changelog - Cypress Documentation
Correctly cast the CYPRESS_VERIFY_TIMEOUT environment variable as a number so Cypress will no longer throw TypeError: Expected the timeout option to be a ......
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
All this means is that you are trying to access a property of an object that is undefined. These usually happens when we...
Read more >Bug listing with status RESOLVED with resolution FIXED as at ...
... Bug:68 - "revised ntp ebuild script for ntp 4.1.72" status:RESOLVED ... baselayout 1.7.0-r1" status:RESOLVED resolution:FIXED severity:minor ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It should be fixed in master (I need to build the dist files) thanks to @fpirsch 👍
I fixed this in my application by modifying
getTable
in layout.js like this:It didn’t break anything else so far, but it’s not really a solution as it doesn’t address the underlying problem (which I couldn’t locate).
Anyway, it might be useful as a reference to anyone looking for a quick fix.