CMS Development

SaraRandolph
Participant

Syntax Error on autogenerated js minification file

SOLVE

I have been successfully using the React CMS Boilerplate to upload a custom React Module in Hubspot. Recently, I went to do some updates on the module and I'm getting this error 

 

 

 

Uncaught SyntaxError: Invalid or unexpected token

 

 

 

 in the minified main.js file (this file is autogenerated and I can not edit it). The error appears to be on the very last line of the minified file which is 

 

 

 

\\#sourceURL=https://f.hubspotusercontent00.net/hubfs/{myHubspotID}/raw_assets/public/{myHubspotFolder}/main.js`

 

 

 

 I have not experienced this error ever before so I'm wondering if something changed with how Hubspot builds the minified files? I did control tests and use the exact same code that worked previously and saw the same error today. Also I will note that the uploading process has no errors. I'm only seeing the error when I drag my module onto our page. That is where it crashes. 

0 Upvotes
1 Accepted solution
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Syntax Error on autogenerated js minification file

SOLVE

Hey @SaraRandolph 

 

A shot in the dark here, but…

 

I believe a sourceURL is supposed to be designated with two forward slashes rather than two back slashes.

This would account for the Uncaught SyntaxError: invalid escape sequence error thrown in FF.

 

But because that's causing an error with the source mapping I'm not sure I can tell where this is happening. If this is in fact the issue.

 

 

EDIT:

If you can get into that fileafter the production build and remove that line all together it might work.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev

View solution in original post

3 Replies 3
Kevin-C
Solution
Recognized Expert | Partner
Recognized Expert | Partner

Syntax Error on autogenerated js minification file

SOLVE

Hey @SaraRandolph 

 

A shot in the dark here, but…

 

I believe a sourceURL is supposed to be designated with two forward slashes rather than two back slashes.

This would account for the Uncaught SyntaxError: invalid escape sequence error thrown in FF.

 

But because that's causing an error with the source mapping I'm not sure I can tell where this is happening. If this is in fact the issue.

 

 

EDIT:

If you can get into that fileafter the production build and remove that line all together it might work.

Kevin Cornett - Sr. Solutions Architect @ BridgeRev
SaraRandolph
Participant

Syntax Error on autogenerated js minification file

SOLVE

Thank you Kevin! I ended up chatting with a developer on the Hubspot slack asking how I could update that file and he pushed up a fix for the issue! 

sharonlicari
Community Manager
Community Manager

Syntax Error on autogenerated js minification file

SOLVE

Hi @SaraRandolph 

 

Welcome to the Community and thank you for the information provided!

 

I'll tag a few of our wizards that can share their knowledge with you 🙂

 

Hey @Kevin-C @Gonzalo @DanielSanchez any advice you can give to @SaraRandolph?

 

Thanks

Sharon


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !