Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Not Compatible with WeChat Browser #6

Closed
haok1402 opened this issue Oct 6, 2022 · 3 comments
Closed

[Bug Report] Not Compatible with WeChat Browser #6

haok1402 opened this issue Oct 6, 2022 · 3 comments
Labels
bug Something isn't working React UI Change in UI Layer is needed

Comments

@haok1402
Copy link
Collaborator

haok1402 commented Oct 6, 2022

Describe the bug
Application Crashed with WeChat Browser

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://visualc0.tk/docs/ with WeChat Browser
  2. See the Error

Expected behavior
C0VM-ts should expectedly work on a variety of browsers.

Screenshots
image

Additional context

{
    "Version": "0.3.0",
    "ReactState": {
        "crashed": true,
        "dbgFullScreen": false,
        "settingMenuOn": false,
        "BC0SourceCode": "",
        "BC0BreakPoints": {},
        "TypedefRecord": {},
        "C0Editors": [
            {
                "title": "Untitled_0.c0",
                "key": 0,
                "content": ""
            }
        ],
        "ActiveEditor": 0,
        "C0BreakPoint": {},
        "PrintoutValue": "",
        "C0Running": false,
        "CompilerFlags": {
            "d": false
        }
    },
    "ReactContext": {
        "mode": "full-page",
        "std_out": true,
        "debug_console": true,
        "c0_only": true
    },
    "GlobalState": {
        "configuration": {
            "DEBUG": true,
            "DEBUG_DUMP_MEM": false,
            "DEBUG_DUMP_STEP": false,
            "MEM_POOL_SIZE": 51200
        }
    }
}
@MarkChenYutian
Copy link
Owner

This can't be solved simply since StructuredClone is a WebAPI function and it's hard to do polyfill on WeChat browser.

I'll add a special check for browser compatibility (i.e. detect WeChat browser) and popup some elegant error message that guides user to open page on REAL browser.

@MarkChenYutian MarkChenYutian added this to the Basic C0 Support milestone Oct 12, 2022
@MarkChenYutian
Copy link
Owner

Turns out the structuredClone is a very new standard of WebAPI and there are potentially many browsers that does not support it, I'm considering to apply some polyfilled version of structuredClone in this project.

https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

Screen Shot 2022-10-12 at 14 48 35

@MarkChenYutian
Copy link
Owner

This issue is resolved by removing all StructuredClone WebAPI calls in project. Now the web app can function properly on WeChat browser.

@MarkChenYutian MarkChenYutian added bug Something isn't working React UI Change in UI Layer is needed labels Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working React UI Change in UI Layer is needed
Projects
None yet
Development

No branches or pull requests

2 participants