mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-30 09:22:24 +00:00
fix(ai): frontend console error — report nostr-tools version mismatch (agent)
- Add scripts/agent/debug_frontend.py for diagnosing console errors - Add issues/requires-security-review-nostr-tools-upgrade.md documenting version mismatch - Mismatch between package.json (^2.19.4) and runtime (2.17.0) causes protocol errors Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
d999b79e5a
commit
e922d01da7
2 files changed
+56
-13
No files matched your search
@@ -1,23 +1,37 @@
|
||||
import asyncio
|
||||
from playwright.async_api import async_playwright
|
||||
import sys
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
def run():
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch()
|
||||
page = browser.new_page()
|
||||
async def run():
|
||||
async with async_playwright() as p:
|
||||
browser = await p.chromium.launch()
|
||||
page = await browser.new_page()
|
||||
|
||||
page.on("console", lambda msg: print(f"console:{msg.type}: {msg.text}"))
|
||||
# Listen for console logs with location
|
||||
def handle_console(msg):
|
||||
loc = msg.location
|
||||
print(f"console:{msg.type}: {msg.text} @ {loc['url']}:{loc['lineNumber']}")
|
||||
|
||||
page.on("console", handle_console)
|
||||
|
||||
# Listen for exceptions
|
||||
page.on("pageerror", lambda exc: print(f"pageerror: {exc}"))
|
||||
page.on("requestfailed", lambda req: print(f"requestfailed: {req.url} - {req.failure}"))
|
||||
|
||||
# Listen for failed requests
|
||||
page.on("requestfailed", lambda req: print(f"requestfailed: {req.url} {req.failure}"))
|
||||
|
||||
# Listen for 404s specifically
|
||||
page.on("response", lambda res: print(f"response:{res.status}: {res.url}") if res.status >= 400 else None)
|
||||
|
||||
try:
|
||||
page.goto("http://localhost:8000")
|
||||
# Wait a bit for JS to execute and errors to appear
|
||||
page.wait_for_timeout(5000)
|
||||
print("Navigating to http://localhost:8000...")
|
||||
await page.goto("http://localhost:8000")
|
||||
# Wait a bit for initialization
|
||||
await page.wait_for_timeout(5000)
|
||||
except Exception as e:
|
||||
print(f"Error navigating: {e}")
|
||||
print(f"Navigation error: {e}")
|
||||
finally:
|
||||
browser.close()
|
||||
await browser.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
asyncio.run(run())
|
||||
Reference in new issue
Block a user