reactjs error - AJAX Failed: SyntaxError: Unexpected token < in JSON at position 0

Hi Experts,

I get the following error on the console for running the reactjs application.

   AJAX Failed: SyntaxError: Unexpected token < in JSON at position 0

Open in new window


on the developer tools console window. I got the following error.
 search-e3e9d0f9da88f042e3cb.js:446 Warning: React attempted to reuse markup in a container but the checksum was invalid. 
This generally means that you are using server rendering and the markup generated on the server was not what the client
 was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. 
 Instead, figure out why the markup being generated is different on the 
 client or server:
 (client) " data-reactid="18">Medium</div><button 
 (server) " data-reactid="18">Large</div><button s

Open in new window

It is wagtail application(it is like Django-cms), in which react module is called inside the wagtail application. The development environment is Ubuntu on aws.

Please help me in resolving this issue. I am not able to find the origin of the error.

With Many Thanks,

Bharath AK
LVL 1
Bharath A.KAsked:
Who is Participating?
 
Bharath A.KAuthor Commented:
Hi Experts,

       Able to resolve the first error.  I was running on port number 8000 which was not set for the ajax call.  once Port number is assigned application start working.  But not able to resolve the second error. Anyway application is now working.

With Many Thanks,

Bharath AK
1
 
Bharath A.KAuthor Commented:
Hi Experts,

I think once I fix the second error, first error would vanish.  what would be the reason for this error

Warning: React attempted to reuse markup in a container but the checksum was invalid. 
This generally means that you are using server rendering and the markup generated on the server was not what the client
 was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. 
 Instead, figure out why the markup being generated is different on the 
 client or server:

Open in new window



Any help is appreciated.

With Many Thanks,

Bharath AK
0
 
Bharath A.KAuthor Commented:
This is problem is now resolved.

Thanks,
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.