microsoft / microsoft/maker.js

NullRef on Text Model once space-character is contained in string (Only when using node.js)

Open
#468 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
2k
Forks
302
Avg merge
21h 28m
Merged PRs (30d)
5

Description

This happens when I try to build a Text Object with a String which contains a space character.

Like: "A B C"

new makerjs.models.Text(font, "A B C", 3)

The following error appears:

Trace: TypeError: Cannot read property '0' of undefined at Object.isPointEqual (/xxx/node_modules/makerjs/dist/index.js:3576:39)

Once I try to build a Text without the space character, it works fine.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with new makerjs.models.Text(font, "A B C", 3) in Node.js and inspect node_modules/makerjs/dist/index.js around Object.isPointEqual. Compare it with a string without spaces; done means text containing spaces builds without the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.