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.

TypeError: Cannot read property 'position' of undefined (Bi-directional loop)

See original GitHub issue

Greetings. I am trying to use the bi-directional loop with an .odt file but can’t seem to get it working as I’ve started with the provided examples in the docs but it doesn’t work as expected and produces the following error:

TypeError: Cannot read property 'position' of undefined
at Object.splitMarkers (<project>/node_modules/carbone/lib/extracter.js:228:41)
at <project>/node_modules/carbone/lib/builder.js:41:50
at Object.preprocessMarkers (<project>/node_modules/carbone/lib/parser.js:286:5)
at <project>/node_modules/carbone/lib/builder.js:38:18
at <project>/node_modules/carbone/lib/parser.js:39:7
at process._tickCallback (internal/process/next_tick.js:61:11)

Environment information:

Angular v8 LibreOffice calc generation .odt template Node.js 10.15.0

Your quick response and help is very much appreciated.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
JosselinTDcommented, Nov 6, 2019

I had it working with this :

{d.title[i].text} {d.title[i+1].text}
{d.content[i].content[i].text} {d.content[i].content[i+1].text}
{d.content[i+1].content[i].text} {d.content[i+1].content[i+1].text}
{
  title: [{text: 'Salutation'}, {text: 'lang'}],
  content: [
    {content: [{text: 'Hello'}, {text: 'en'}]},
    {content: [{text: 'Bonjour'}, {text: 'fr'}]}
  ]
}

I never use a direct value from an array. Array contains Object which contains the value to use.

For the doc example, try by using something like that :

{
  myArray : [{"brand": etc...}, {"brand": etc...]
}

and changing the template with d.myArray[i]

2reactions
officeutilscommented, Aug 26, 2021

This feature does not work at all. For .docx files too. Remove it from your documentation. You stole a lot of my time folks. Only 2 years have passed since the error was detected

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'position' of undefined (Bi-directional ...
I am trying to use the bi-directional loop with an .odt file but can't seem to ... TypeError: Cannot read property 'position' of...
Read more >
Uncaught TypeError: Cannot read property 'position' of ...
This is all about passing parameter and expose objects. You can't access the ui parameter in your "myFunction" because, if I guess right,...
Read more >
TypeError: Cannot read properties of undefined (reading 'DOB ...
When initializing your for loop to iterate through an array using its length and starting at 0 you need to use < rather...
Read more >
Cannot read property 'firstName' of undefined. Help needed
This error means you have done everything correct (see how you printed out the first three objects on the contacts list!) apart from...
Read more >
HTML Standard
1.9.1 How to read this specification; 1.9.2 Typographic conventions ... and outerText properties; 3.2.8 Requirements relating to the bidirectional algorithm.
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