JS - Can't combine lib files JS - Can't combine lib files javascript javascript

JS - Can't combine lib files


Most probably one of your js files is missing a ; at the end. Open up the one you believe is causing the error and add a ; at the end, or add a ; to the very first line of the next js file.


Modifying the javascript code is not fixing the root cause of the problem so this could happen again as soon as you introduce a new JavaScript file.

You have at least few choices for a permanent fix - they involve changing the build so that this cannot happen in the future, even if a semi-colon is missing:

  • Inject a ; between the files you are concatenating. This is usually a simple one-line change depending on how you are concatenating the files.
  • Minify the files first and then concatenate. This should leave a \n between the files you are concatenating, allowing ASI to take care of this for you.


just add semi-clone and newline

';\n'

at end of each file