The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 62,651β€…    Votes:  2β€…
Tags: php   html   module   syntax-error  
Link: πŸ” See Original Answer on Stack Overflow ⧉ πŸ”—

URL: https://stackoverflow.com/q/71403965
Title: SyntaxError: '' string literal contains an unescaped line break
ID: /2022/03/09/SyntaxError_-__-string-literal-contains-an-unescaped-line-break
Created: March 9, 2022
Upload: April 8, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


Search engine brought me to this Q&A but the solution is totally different. It’s posted just in case it helps others.

This error was searched:

Uncaught SyntaxError: '' string literal contains an unescaped line break

The line in question contained:

    alert('validUrlSyntax: ' + validUrlSyntax +
          ' validUrlExists: ' + validUrlExists +
          ' time to check: ' + elapsedTime + ' milliseconds`)

Notice the last apostrophe is really a back tick. Changing the back tick to an apostrophe ' solved the problem.

⇧ Temporarily disable distracting software stdin: invalid argument  β‡©