Skip to content

Bug: CodeMirror breaks with too much code #1080

@knackstedt

Description

@knackstedt

Describe the bug

If you paste a bunch of code into CM, it starts breaking and throwing this error to console.error. If you then try to type with your keyboard to edit the large query CodeMirror starts an undefined property read error.

Image

Steps to reproduce

Open Surrealist
Paste the following in the Query editor.

Details

DEFINE FUNCTION fn::odatav4($query: string) {
    RETURN function() {
<PASTE main.js CODE HERE -- TOO MUCH FOR GH.>
        return 1;
    }
};
RETURN fn::odatav4('')

main.js

Expected behaviour

The editor to still work with large text bodies.

Surrealist Environment

Platform: Web
Navigator: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Version: 3.6.12
Flags: feature_flags: false, query_view: true, explorer_view: true, graphql_view: true, designer_view: true, auth_view: true, functions_view: true, parameters_view: true, apidocs_view: true, themes: true, syntax_themes: false, newsfeed: true, database_version_check: true, highlight_tool: false, legacy_serve: false, cloud_enabled: true, cloud_endpoints: default, cloud_access: true, cloud_killswitch: true, changelog: auto, website_base: production, support_tickets_endpoint: production, support_tickets: true, sidebar_customization: false, gtm_debug: false, sidekick_ai: true, v3_migration_tooling: false, sandbox_deploy: true

Contact Details

discord:.digitalglitch

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingTriageThis issue is new

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions