cli icon indicating copy to clipboard operation
cli copied to clipboard

Terminal command netlify dev --live generating broken links

Open c-semaan opened this issue 3 years ago • 6 comments

image image

There seems to be an issue with generating links using netlify dev --live. It sometimes output the link as "netllify" or "netlifyy" as seen in the image attached.

I search through my entire projected to see if i have mispelled netlify and everything seems to be find. Spend quite sometime pointlessly debugging just to notice this in the end.

c-semaan avatar May 31 '22 17:05 c-semaan

Hi! This is a super interesting bug 😲 Is there some specific thing you can do to reproduce this, or does this show up randomly? Also, is it only the rendering that's broken? Or are your functions also available under the misspelled endpoint?

Skn0tt avatar Jun 01 '22 09:06 Skn0tt

I am on cli 8.16.1

Reproducing the issue:

First try:

  1. Opened the project in VScode
  2. Netlify build in terminal
  3. Netlify dev --live in terminal -> Works as expected. image

Second try:

  1. Again Netlify dev --live -> Works as expected image

Third try:

  1. I split my screen in two windows. [ half google chrome, other half vscode]
  2. Netlify build in terminal
  3. Netlify dev --live -> Issue reproduced! image image

"is it only the rendering that's broken? Or are your functions also available under the misspelled endpoint?"

-> Functions works as expected when I manually correct the spelling mistakes in the links.

c-semaan avatar Jun 01 '22 13:06 c-semaan

Wow, what a riddle! This is interesting :D

What stands out to me is that in the first screenshot you share, the duplicated character is always the last one before it wraps around to the next line. Could you try playing around with the terminal width to see if that's true always? It kind of looks like a rendering bug in the terminal. I see you're on windows, what terminal is this (VS-Code builtin terminal/powershell/cmd.exe/something else)?

Skn0tt avatar Jun 01 '22 13:06 Skn0tt

This bug could be caused by terminal-link, which we're using to make this URL clickable.

Skn0tt avatar Jun 01 '22 13:06 Skn0tt

@jackiewmacharia I see you worked on https://github.com/netlify/cli/issues/4311, do you have an idea what might be causing this?

Skn0tt avatar Jun 01 '22 13:06 Skn0tt

Trying out different VScode width

  1. Width 1300x852 ->Issue with links persists image

  2. Width 1530x943 -> No issue with links. Even after resizing window! image image

It seems that the issue occurs when there is a line break upon generating the link in correlation with the terminal width size.

what terminal is this (VS-Code builtin terminal/powershell/cmd.exe/something else)? -> I am on VScode builtin terminal.

Version: 1.67.2 (user setup) Date: 2022-05-17T18:15:52.058Z Electron: 17.4.1 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.22621

c-semaan avatar Jun 01 '22 13:06 c-semaan