Skip to main content
saadlaws
Participant
November 28, 2023
Answered

error in CPXHRLoader.js

  • November 28, 2023
  • 4 replies
  • 944 views

I am using Captivate classic and I have published a project and uploaded to the web. When I run the project I get incesent error messages in console - Uncaught SyntaxError: "[object Object]" is not valid JSON.

 

This seems to be pointing to the CPM.js and CPXHRLoader.js files. 

 

The main problem is that if i have any custom JS in the project, it will not run any of the functions and the project grinds to a halt. Any suggestions on how to fix this? I have also tried taking out all custom JS and I still get the errors in console, but the project plays normally then. 

    This topic has been closed for replies.
    Correct answer Lilybiri

    I suspect in that case that it is linked with your custom JS. Sorry, I am not a JS expert, my focus is on Captivate itself and all of its features.

    4 replies

    Participant
    May 20, 2024

    In our case we found it was a browser plugin causing the issue.  In our case the Angular DevTools extension.  

     

    Lilybiri
    Legend
    May 21, 2024

    @jamess77796422 Thanks for pointing out a possible cause of this problem.

    Participant
    February 22, 2024

    Hi,

    it could be a bug because I have exactly the same problem (just found out) and I am using the latest Captivate classic version 11.8.2.254. I have published several projects and uploaded them to the web. Important side information: I have not included any custom JS. When I run the projects, I get almost the same error messages in the console:
    Uncaught SyntaxError: "[object Object Object]" is not a valid JSON
    at JSON.parse (<anonymous>)
    at eval (eval at e (CPXHRLoader.js:37:226), <anonymous>:1176:67)
    As you can see, the error leads to the CPXHRLoader.js file, which is located in the "assets" subfolder of the project folder. The project plays normally, but it seems that the error slows down the loading process and partially causes the browser window to freeze, resulting in a poor user experience.
    Could someone already fix this problem and help me further? Many thanks in advance!

    Inspiring
    January 30, 2024

    I created a brand new Captivate Classic project.

    It consists of one page. The only content is text blocks.

    Completion/success is based on page views.

    When I upload it to SCORM Cloud as a test, it also throws a constant stream of JSON parsing errors exactly like what saadlaws is seeing.

    Lilybiri
    Legend
    January 30, 2024

    Which exact version are you using? The full number can be found under Help, About Captivate.

    Do you use PNG images? They result in JSON files on publishing. 

    Inspiring
    January 30, 2024

    Version 11.8.2.254

    No images at all. It's literally a one page project with only 2 text labels. The errors begin as soon as the course window is loaded. 

    Lilybiri
    Legend
    November 28, 2023

    Does the webserver support JSON? It is used for PNG images.

    saadlaws
    saadlawsAuthor
    Participant
    November 29, 2023

     

    Yes. I am using firebase hosting. 

    Lilybiri
    LilybiriCorrect answer
    Legend
    November 29, 2023

    I suspect in that case that it is linked with your custom JS. Sorry, I am not a JS expert, my focus is on Captivate itself and all of its features.