Forum Discussion

MichaelCarlino-'s avatar
MichaelCarlino-
Community Member
2 months ago

user.js script error

Hello, all in need of serious help.  All of a sudden when I preview my file that runs javascript that has multiple javascript that runs on different slides.  I am getting an unexpected token "}". and is says user.js.4090.  Can anyone tell me where I can fix this?  I am not sure where to go since this is in my preview.  I understand the error I just don't know where to go to fix it.

 

I have attached a screenshot to show the error.  Also, this shows up even before I run any of my scripts.

  • sakeban's avatar
    sakeban
    Community Member

    It seems like the error is pointing to an extra or misplaced curly brace "}" in your user.js script. Here's how you can troubleshoot and fix it:

    1. Locate the File: The error mentions user.js:4090, which means it's in line 4090 of your user.js file. Open the file in a text editor or IDE and go to that line.
    2. Check for Extra/Missing Braces: Review the surrounding code for mismatched curly braces {}. Make sure every opening brace { has a corresponding closing brace }.
    3. Validate Syntax: Use an online JavaScript validator or the built-in tools in your IDE to check for any syntax errors.
    4. Minified JS Issue: If the user.js file is minified or bundled, it may be hard to debug. Consider using a prettifier to reformat the code for readability and then check for errors.

    Let me know if you'd like help debugging further!

     

  • It will be in one of your scripts that you are using. If you use the console you can view the user.js there or publish to web and open from the source files.