I am seeing the "Uncaught SyntaxError: Unexpected token '<' " error at line 1 of my local jquery-3.6.0.min.js file upon clicking the 'Inspect' option after loading my HTML file in Chrome.
The highly unexpected thing is, when I move to "sources" on the inspect window, I can see that the jquery-3.6.0.min.js file is available. However, its contents are the same as my HTML file! I have attached pictures of examining both index.html and my local JQuery file and you can see that they have the same content.
inspecting jquery-3.6.0.min.js:

Here is how I have loaded the JQuery file into HTML:
<html>
<head>
<title>Soren</title>
<script type="text/javascript" charset="UTF-8" src="./js/jquery-3.6.0.min.js"></script>
...
</html>
I am quite puzzled by this error because upon reading online matter, I at most expected an error 404 page to show up as the JQuery file if there were problems loading it, but the last thing I expected was the JQuery file to contain the parent HTML file's content.
Another point to note is that I am launching the HTML file via a server in python such as:
class MyServer(BaseHTTPRequestHandler):
def do_GET(self):
""" do_GET() can be tested using curl command
'curl http://server-ip-address:port'
"""
file = codecs.open("/home/pi/Burger/index.html", "r", "utf-8")
html = file.read()
temp = os.popen("/opt/vc/bin/vcgencmd measure_temp").read()
self.do_HEAD()
status = ''
self.wfile.write(html.format(temp[5:], status).encode("utf-8"))
if __name__ == '__main__':
print("Online now")
http_server = HTTPServer((host_name, host_port), MyServer)
print("Server Starts - %s:%s" % (host_name, host_port))
Any help will be greatly appreciated! Thanks in advance.
Abhinandan