-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[Live HTML]: Live Preview can never update if initially launched with syntax error #5338
Comments
Thanks for the detailed recipe. When whitespace occurs following a |
@redmunds I'm not sure that It seems to me that the best solution here is to have a new state in which live development starts in the "invalid" state. Once the document becomes valid for the first time, then it is sent to the browser. What do you think, @njx? (marking this medium priority) |
Sounds like there are 2 separate cases. As for the |
I think we need to fix the problem @dangoor pointed out in any case (I had had a vague feeling earlier that there might be a bug here but never actually tested it). But I'm a little confused about how that comes up with these steps, since in the bug case the file doesn't start out invalid, if I'm reading the steps correclty. Regarding whether we decide to be more lenient about the If this were a common type of invalid HTML that people want to preserve, then I think we should consider allowing it, but I don't have a good sense of that. |
@njx The file does start out invalid, assuming our tokenizer currently gets stuck in the open tag state for My main concern is less about whether |
Ah, I missed that. But yes, we definitely need to fix it. |
The same happens to me. While editing html file, delete two rows (list elements) I wasn't using. then live preview stopped 'cause "syntax error", but there´s no syntax error. I've to stop and start over. Hope this helps. Thank you. |
@brickyenne Was Live HTML working and then stopped working? If so, that may be a different problem. Brackets should highlight where it thinks there's an error in the file. If you continue to have problems, if you can share some or all of your HTML file with us (possibly in a new issue on GitHub) that may help. |
Strange thing is there’s no error visible, no pink tag. Just deleted a couple of list ítems and every stopped working. Just pink live editing icon (switches back to orange after saving but page does not gets updated).Every now and then receive an alert box saying: Cannot load page. Error in live editing” Do you thing I should post this as a bug? Thank you. Enviado con Correo de Windows De: Kevin Dangoor @brickyenne Was Live HTML working and then stopped working? If so, that may be a different problem. Brackets should highlight where it thinks there's an error in the file. If you continue to have problems, if you can share some or all of your HTML file with us (possibly in a new issue on GitHub) that may help. — |
@brickyenne From your description, it sounds like you may be encountering this bug, but you may also be encountering something different. I would recommend opening a separate bug just to be sure that we're correctly diagnosing what you're seeing without getting confused with the problem reported here. Please be sure to include the steps you took and when specifically live HTML worked and didn't work for you. (It's not clear to me right now if you had seen any changes come through to the browser). Any example HTML that reproduces the problem will be a big help. |
Medium pri to @dangoor |
Changing title to clarify that the bug only occurs when Live Development is started with a syntax error (was: "[Core][Live HTML]: Live preview cannot continue to update if the orginal html file ever has syntax error.") |
Although @dangoor it seems like there is a secondary bug here: in the first screenshot, the file supposedly has syntax we consider invalid ( |
reviewed - 1.0 milestone. |
Reviewed, leaving open for 1.0. |
Would we want a behavior that prevented Live Preview from opening if the HTML cannot be understood by instrumentation? |
I think the desired behavior would be the same as if the user opened a page with valid syntax and then edited page so that syntax was no longer valid. In this case, the first line with a syntax error has a red line number and HTML is not updated until syntax error is fixed. This would be consistent with current behavior. One problem with this approach is if the syntax error is on a line that's not in the current view port -- let us know if you can think of a way to inform user of that case. |
The problem persists in 1.7. |
Steps:
body
:< abc
.<
andabc
, or just make any change in this file. The tooltip of Live preview icon will show "not updating due to syntax error".<
to make sure that there isn't syntax error in this file.Result:
Live preview cannot updating the file at step6. I have to reload the webpage through chrome browser.
Expected:
At step6, Live preview should work well for there isn't any syntax error.
ENV: MAC10.8 and Win8.1 English OS.
Build: 0.32.0-9618
Snapshots:
![1](https://camo.githubusercontent.com/aad082366ef4396ca2fe43f6ceba7d3d2ed8dba8f23fd93a498a5a671ba22565/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f343235313536332f313230373936382f32343762316135382d323563352d313165332d383165612d3838333466646338636663352e6a7067)
![2](https://camo.githubusercontent.com/7b7959aa82e48650c62fc9e2140a7a25232e03a580faf97ac57c52b87a7a8657/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f343235313536332f313230373936392f32343738346166382d323563352d313165332d393262342d6466356634323437313236322e706e67)
![3](https://camo.githubusercontent.com/746b737233380a2765e2d346637a9bfd015e57184e596c0e0c51e8b45e1e59a6/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f343235313536332f313230373937302f32343738323530612d323563352d313165332d383738382d3735666666396464613434372e706e67)
![4](https://camo.githubusercontent.com/3611ed07f3b3a86fb6b86b569d1f50b499449a174fe0f4e255df8d230aa403e0/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f343235313536332f313230373937312f32343763343630382d323563352d313165332d386565302d6533313265363961616435342e706e67)
Please refer to snapshots for details:
Step3:
Step4:
Step5:
Step6:
The text was updated successfully, but these errors were encountered: