Console errors and blank page on fresh install and first run
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python, typescript
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện trang trắng với code-server 4.105.1 phía sau proxy Quart được hiển thị và kiểm tra các phản hồi cho static/out/nls.messages.js và static/out/vs/code/browser/workbench/workbench.js. So sánh các lỗi trong console của trình duyệt với các phản hồi được proxy truyền theo luồng; hoàn thành khi bản cài đặt mới tải mà không có các lỗi cú pháp này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Firefox 143.0.4
- Local OS: Fedora 41
- Remote OS: Ubuntu 24.10
- Remote Architecture: amd64
code-server --version: 4.105.1 811ec6c1d60add2eb92446161ca812828fdbaa7f with Code 1.105.1
Fresh install, my first try using it. I tried reinstalling twice (while removing the cached file), including once from dpkg and .deb package instead of just .sh install script like on the previous tries. Blank page and such errors in the firefox console
Uncaught SyntaxError: "" literal not terminated before end of script [nls.messages.js:12:1268](https://comfy.kpi.kul.pl/vscode/stable-811ec6c1d60add2eb92446161ca812828fdbaa7f/static/out/nls.messages.js)
Uncaught SyntaxError: missing } after function body
[workbench.js:10:1794](https://comfy.kpi.kul.pl/vscode/stable-811ec6c1d60add2eb92446161ca812828fdbaa7f/static/out/vs/code/browser/workbench/workbench.js)note: { opened at line 10, column 1723[workbench.js:10:1723](https://comfy.kpi.kul.pl/vscode/stable-811ec6c1d60add2eb92446161ca812828fdbaa7f/static/out/vs/code/browser/workbench/workbench.js)
Steps to Reproduce
Well this one is awkward, because I am using it in my personal quart service on an endpoint with such proxy code (I want to give access to me and few of my friends on my home server):
# --- Code-server logic ---
code_server_sessions = {}
async def start_code_server(username):
if username in code_server_sessions:
return code_server_sessions[username]['port']
if not os.path.exists(f"/home/ubuntu/code_servers/{username}"):
os.makedirs(f"/home/ubuntu/code_servers/{username}/ext", exist_ok=True)
port = random.randint(5200, 5300)
while port in [session['port'] for session in code_server_sessions.values()]:
port = random.randint(5200, 5300)
command = [
"code-server",
"--bind-addr", f"127.0.0.1:{port}",
"--auth", "none",
"--user-data-dir", f"/home/ubuntu/code_servers/{username}",
"--extensions-dir", f"/home/ubuntu/code_servers/{username}/ext",
"--disable-workspace-trust",
"--disable-telemetry",
"--disable-update-check"
]
env = os.environ.copy()
env["CODE_SERVER_DISABLE_CSP"] = "true"
proc = subprocess.Popen(command, env=env)
code_server_sessions[username] = {
'process': proc,
'port': port
}
await asyncio.sleep(2)
return port
@app.route("/vscode/", defaults={'path': ''}, methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
@app.route("/vscode/<path:path>", methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH'])
@login_required
async def proxy_vscode(path):
username = current_user.username
port = await start_code_server(username)
qs = request.query_string.decode()
target = f"http://127.0.0.1:{port}/{path}" + (f"?{qs}" if qs else "")
async with httpx.AsyncClient(follow_redirects=True, timeout=httpx.Timeout(60.0, read=60.0)) as client:
req = client.build_request(
request.method, target,
headers = {k:v for k,v in request.headers.items() if k.lower() not in ("host", "cookie")},
content = await request.get_data()
)
resp = await client.send(req, stream = True)
async def stream_response():
try:
async for chunk in resp.aiter_bytes():
yield chunk
except httpx.ReadError as e:
print("ReadError while streaming:", e)
return
headers = [(k, v) for k, v in resp.headers.items() if k.lower() != 'content-security-policy']
headers.append((
"Content-Security-Policy", "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:;"))
return Response(
stream_response(),
status = resp.status_code,
headers = headers
)
@app.websocket("/vscode/<path:path>")
@login_required
async def vscode_proxy_ws(path):
username = current_user.username
port = await start_code_server(username)
qs = websocket.scope["query_string"].decode()
target = f"ws://127.0.0.1:{port}/{path}" + (f"?{qs}" if qs else "")
try:
async with websockets.connect(target, subprotocols = websocket.headers.get_list('Sec-WebSocket-Protocol')) as backend_ws:
async def front_to_back():
try:
while True:
msg = await websocket.receive()
await backend_ws.send(msg)
except websockets.exceptions.ConnectionClosed:
pass
async def back_to_front():
try:
async for msg in backend_ws:
await websocket.send(msg)
except websockets.exceptions.ConnectionClosed:
pass
await asyncio.gather(front_to_back(), back_to_front())
except Exception as e:
app.logger.error(f"VSCode WebSocket proxy error for user {username}: {e}", exc_info=True)
Expected
Well, I expected it to load. I debugged some of quart-side proxy code errors and I think it should be fine there, so I resorted to asking here if this might be a code-server issue. But I still might be wrong.
Actual
Site empty, return codes 200 on everything, errors in console:
Uncaught SyntaxError: "" literal not terminated before end of script [nls.messages.js:12:1268](https://comfy.kpi.kul.pl/vscode/stable-811ec6c1d60add2eb92446161ca812828fdbaa7f/static/out/nls.messages.js)
Uncaught SyntaxError: missing } after function body
[workbench.js:10:1794](https://comfy.kpi.kul.pl/vscode/stable-811ec6c1d60add2eb92446161ca812828fdbaa7f/static/out/vs/code/browser/workbench/workbench.js)note: { opened at line 10, column 1723[workbench.js:10:1723](https://comfy.kpi.kul.pl/vscode/stable-811ec6c1d60add2eb92446161ca812828fdbaa7f/static/out/vs/code/browser/workbench/workbench.js)
Logs
Screenshot/Video
No response
Does this bug reproduce in native VS Code?
This cannot be tested in native VS Code
Does this bug reproduce in GitHub Codespaces?
I did not test GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
No response
- Ngôn ngữ chính
- TypeScript
- Star
- 79.4k
- Fork
- 6.9k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 39
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/code-server
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
coder/code-server#8017 · 2 bình luận ·
-
Bump proxy-addr to 2.0.8 Đang mởsecurity
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
coder/code-server#8013 · 4 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7976 · 2 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
coder/code-server#7962 · 3 bình luận ·
-
bug needs-investigation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
coder/code-server#7955 · 1 bình luận ·
Tất cả issue của coder/code-server
Issue tương tự
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Đang mởclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
supermomonga/zcode-acp#24 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
growthbook/growthbook#7100 ·
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100