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.

How to display source file for conflicting fields types?

See original GitHub issue

Hi, When building my site containing a lot of .md files full of frontmatter, I get warnings about conflicting field types. This is a valuable information, but it’s missing one thing: which files are conflicting.

I’ve seen this conversation here where you can see screenshots with the path to the source file. Screenshot

But for me source is not showing up.

MarkdownRemark.frontmatter.mepheader.provenance.prov_number:
 - type: object
   value: { anote: [Object] }
 - type: string
   value: 'p. 264'
MarkdownRemark.frontmatter.head:
 - type: object
   value: { dateline: 'sans date', persname: [Object], object: 'Dessin de M. Isabey de la manufacture des frères Sevennes à Rouen.' }
 - type: string
   value: '[1133]'

Digging a little where the message is actually prompted, I’ve found that the source line is displayed only if the node has a description:

type-conflict-reporter.js

    report.log(
      `${this.selector}:${sortedByTypeName
        .map(
          ([typeName, { value, description }]) =>
            `\n - type: ${typeName}\n   value: ${formatValue(
              value
            )}${description && `\n   source: ${description}`}` // <-- Here
        )
        .join(``)}`
    )

I’ve quickly looked around but didn’t find what is this description. On the node interface documentation page no sign of it.

I think adding this description is not the way to go, but I’m missing leads.

Any suggestion how to proceed?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
vladarcommented, Mar 13, 2020

@henricazottes You are right about first - it is a node id that you can use to find a root ancestor node. I guess the best advice I can give is to try to restore this line

The implementation of this function still exists here but it is not easily accessible from type conflict reporter anymore. I suspect it was the main reason for the change.

So you will probably have to re-implement it using node store directly. I would suggest putting this new implementation in the utils folder for now as a standalone utility function.

1reaction
henricazottescommented, Mar 9, 2020

You’re right, I’ll wait for his answer before investigating more

Read more comments on GitHub >

github_iconTop Results From Across the Web

Identify indexes with conflicting field types · Issue #7661 - GitHub
To save space I wonder if it would be better to display a list of indices for each field type (so essentially the...
Read more >
Kibana: How to solve mapping conflict - Dev - Petr Sobeslavsky
See the source of the problem. As the message says, the problem is that a field has different type in different indices in...
Read more >
Field name conflicts - Informatica Documentation
The Mapping Designer generates a field name conflict error when you validate a mapping that has fields with matching names from different transformations....
Read more >
How i can resolve conflict type AcfLink - reactjs - Stack Overflow
Show activity on this post. You can alias both fields with: button { newName1: url newName2: title }. After that, you will need...
Read more >
NetSuite Applications Suite - Resolving Conflicting Objects
Resolving Conflicting Objects. When you install a customization bundle, the objects in the bundle are checked against preexisting custom objects in your ...
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