Error validating template: React throw Error message

kgwozdz
Participant

Hi all,

 

I got an error when uploading files to Hubspot. The error relates to a message that is contained in the React core - the error itself is not triggered, it's just that Hubspot is picking up on the syntax that is in the text message and not in the actual app code...

 

[ERROR] Error validating template.
[ERROR] line 8087: Error parsing 'marginRight: spacing + 'em'': syntax error at position 135, encountered ':', expected '}'

 

React core fragment code: 

if (!(props.style == null || typeof props.style === 'object')) {
    {
      throw Error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + ( ReactDebugCurrentFrame$3.getStackAddendum() ) );
    }
  }

 

Any ideas how to handle this? 

Thanks in advance!

 

 

 

 

0 Upvotes
2 Replies 2
Jaycee_Lewis
Thought Leader

Hi, @kgwozdz 👋 Were you able to make any progress here?

 

If not, have you already tried escaping out the problematic parts of the string? 

{{'}} 

 

Or moving the error message out of the code and into a constant? To get around the syntax checking error.

 

In full disclosure, I am not a React expert. And I'm always down to learn more.

 

Best,

Jaycee

 





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
kgwozdz
Participant

Hi @Jaycee_Lewis thanks for the reply.

The problem is that this is the core of the framework and not my code - I can't just change the framework and even if I did, the next time when React updates, the change will be overwritten.