Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

error in CPXHRLoader.js

Community Beginner ,
Nov 28, 2023 Nov 28, 2023

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. 

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

LEGEND , Nov 28, 2023 Nov 28, 2023

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

Translate
LEGEND , Nov 29, 2023 Nov 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.

Translate
LEGEND ,
Nov 28, 2023 Nov 28, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 29, 2023 Nov 29, 2023

 

Yes. I am using firebase hosting. Screenshot 2023-11-29 at 2.20.16 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 29, 2023 Nov 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 29, 2023 Nov 29, 2023

Something that I have noticed also is that if i have external JS in the project, it will run without problem the first time, but the second time it throws an error. For instance if a user tries to login, it works the first time. But if they enter the incorrect details, for instance, and need to try again, it doesn't work. Screenshot 2023-11-29 at 2.29.43 PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 30, 2024 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 30, 2024 Jan 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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 30, 2024 Jan 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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 30, 2024 Jan 30, 2024

It could be a bug, that version is rather buggy.

I would try the usual troubleshooting, in this case Cleaning Preferences. Find the subfolder 'utils' under the installation folder and run  CleanPreferences while Captivate is closed.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 22, 2024 Feb 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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 20, 2024 May 20, 2024

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

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 21, 2024 May 21, 2024
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources