Skip to content

avoid-accidental-submissions throws on pre-fork edit pages #4194

Closed

Description

@fregante

URL: https://github.com/MatthewL246/hello-world/edit/main/CONTRIBUTING.md

Refined GitHub → hide-markdown-diff → TypeError: undefined has no properties
    init hide-markdown-diff.tsx:24
    runFeature index.tsx:125
    setupPageLoad index.tsx:147
    add index.tsx:248
    $e pjax.ts:98
    Ne pjax.ts:311
    execute navigation.ts:62
    execute navigation.ts:17
    Y index.js:96

Console error only, not a real issue. I'm not sure if we should start fixing these issues in more direct ways instead of through exclude, which might not work with elementReady features.

For example in this case, if the first expected item isn't found, let the error throw only if it's not isEmptyPage. I wonder if this mechanism should be implemented via some sort of "deferred exclude" list of checks, or if exclude should just be treated this way (likely troublesome)

Activity

  1. yakov116 commented on Apr 5, 2021

    @yakov116
    Member

    In the past we did a check on these pages to make sure the selector exists

  2. fregante commented on Apr 5, 2021

    @fregante
    MemberAuthor

    We have that in many other pages but then we make all errors silent, we need a better way to handle that

  3. yakov116 commented on Apr 5, 2021

    @yakov116
    Member

    we need a better way to handle that

    But that is in general, by having a detection if a specific selector exists. I think such a thing will be very hard if we are supporting GHE. Since the DOM will change and the warning will be moot for some users.

  4. changed the title [-]`hide-markdown-diff`: throws on pre-fork edit pages[/-] [+]`avoid-accidental-submissions` throws on pre-fork edit pages[/+] on Nov 15, 2021
  5. cheap-glitch commented on Nov 15, 2021

    @cheap-glitch
    Contributor

    Renamed because we dropped hide-markdown-diff.

    That said, the discussion is still valid, as exemplified by this error when visiting the URL in the first post:

    ❌ avoid-accidental-submissions 0.0.0 → TypeError: select_dom__WEBPACK_IMPORTED_MODULE_1__["default"](...) is undefined
        addQuickSubmit moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:3322
        runFeature moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:8019
        setupPageLoad moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:8037
        add moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:8092
        add moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:8093
        tsx moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:3356
        __webpack_require__ moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:25475
        <anonymous> moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:25731
        <anonymous> moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:25947
        <anonymous> moz-extension://c2ad1c81-15a9-47dc-844b-f4235a6885c1/build/refined-github.js:25949
    refined-github.js:7942:11
    

    The faulty line:

    select('input#commit-summary-input')!.classList.add('js-quick-submit');

  6. added
    Please! ♥︎
    on Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Please! ♥︎acceptedbugoldest bug 🦖under discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions