# Error validating template: React throw Error message

**URL:** <https://community.hubspot.com/t/error-validating-template-react-throw-error-message/89015>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [September 5, 2023, 8:38pm UTC](https://community.hubspot.com/t/error-validating-template-react-throw-error-message/89015 "2023-09-05T20:38:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgwozdz](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@kgwozdz](https://community.hubspot.com/u/kgwozdz)\
**Post date:** [September 5, 2023, 8:38pm UTC](https://community.hubspot.com/t/error-validating-template-react-throw-error-message/89015/1 "2023-09-05T20:38:43Z")

</div>

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:

```lia-code-sample
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!

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [September 7, 2023, 6:21pm UTC](https://community.hubspot.com/t/error-validating-template-react-throw-error-message/89015/2 "2023-09-07T18:21:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kgwozdz](https://avatars.discourse-cdn.com/v4/letter/k/bc79bd/32.png) [@kgwozdz](https://community.hubspot.com/u/kgwozdz)\
**Post date:** [September 8, 2023, 11:26am UTC](https://community.hubspot.com/t/error-validating-template-react-throw-error-message/89015/3 "2023-09-08T11:26:59Z")

</div>

Hi [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) 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.
