VS Code Live Server will not load Index.html with error ERR_CONNECTION_RESET until it succeeds with no clear justification

huangapple go评论82阅读模式
英文:

VS Code Live Server will not load Index.html with error ERR_CONNECTION_RESET until it succeeds with no clear justification

问题

I'm developing a small JavaScript application with one HTML file, one JS file, and the inclusion of 2 libraries (bootstrap and font awesome). Also, I installed the Live Server plugin.

When I open VS-Code, click on the Index.html file and then the "Go Live" button, the browser opens, thinks for a while, and then an error message is displayed at the console with ERR_CONNECTION_RESET code.

I then try switching browsers (between Edge and Chrome) back and forth, restart things a number of times without making any change to the code or configuration (except the browser switching) till, unexplainably, the file is successfully loaded, and hence development can proceed.

Though eventually I'm able to proceed with my work, the above process takes quite some time and it is extremely annoying. Also, the fact that I have no explanation about the reason for this strange condition keeps me puzzled.

The page is built as a set of nested tables, and in one of these tables, the tags are <body> ... </body> (accidentally) instead of <tbody> ... </tbody>.

英文:

I'm development a small JavaScript application with one HTML file, one JS file and the inclusion of 2 libraries (bootstrap and font awesome). Also, I installed the Live Server plug.

When I open VS-Code, click on the Index.html file and then the "Go Live" button, the browser opens, thinks for a while and then an error message is displayed at the console with ERR_CONNECTION_RESET code.

I then try switching browsers (between Edge and Chrome) back and forth, restart things a number of times without making any change to the code or configuration (except the browser switching) till, unexplainably, the file is successfully loaded and hence development can proceed.

Though eventually I'm able to proceed with my work, the above process takes quite some time and it is extremely annoying. Also, the fact that I have no explanation about the reason for this strange condition keeps me puzzled.

The page is built as a set of nested tables and, in one of these tables, the tags are &lt;body&gt; ... &lt;/body&gt; (accidentally) instead of &lt;tbody&gt; ... &lt;/tbody&gt;.

答案1

得分: 0

请参阅https://github.com/ritwickdey/vscode-live-server/issues/1131,在那里显示了如果在源代码中有奇怪/混乱的&lt;/body&gt;标签,Live Server就会出现问题。

这在问题下的评论中被发现是个问题。提问者在本来想写&lt;/tbody&gt;的地方写成了&lt;/body&gt;。通常情况下,由拼写错误引起的问题应该被关闭,但这是一个例外,因为实际上有一些有价值的东西可以让未来的读者受益。

英文:

See https://github.com/ritwickdey/vscode-live-server/issues/1131, where it's shown that Live Server trips up if you have weird / messed-up &lt;/body&gt; tags in your source code anywhere.

This was found to be the case in the comments under the question. The asker of this question had a typo where they meant to write &lt;/tbody&gt;, but instead wrote &lt;/body&gt;. Normally typo-caused questions should be closed, but this is an exception because there's actually something valuable to be learned here that future readers can benefit from.

huangapple
  • 本文由 发表于 2023年8月9日 18:30:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76866883.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定