question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: "parameter 1 is not of type "Element"." on Firefox.

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://testbdweb.educoder.net/ec_courses/148/ec_course_support_setting

Steps to reproduce

I am using this code in a dynamic form. And I got the error on firefox when the form init. The code works fine on Chrome. Any ideas? Thanks.

{getFieldDecorator(`target_contents[${k}]`, {
                    // validateTrigger: ['onChange', 'onBlur'],
                    rules: [{
                        required: true,
                    //     whitespace: true,
                        message: "请填入目标内容",
                    }],
                })(
                <TextArea autosize placeholder="" style={{  width: '100%', marginRight: 8 }} />
            )}
/**
     * Starts observing provided element.
     *
     * @param {Element} target - Element to be observed.
     * @returns {void}
     */
    ResizeObserverSPI.prototype.observe = function (target) {
       if (!arguments.length) {
            throw new TypeError('1 argument required, but only 0 present.');
        }
        // Do nothing if current environment doesn't have the Element interface.
        if (typeof Element === 'undefined' || !(Element instanceof Object)) {
            return;
        }
        if (!(target instanceof getWindowOf(target).Element)) {
            throw new TypeError('parameter 1 is not of type "Element".');
        }

What is expected?

no error.

What is actually happening?

got error: TypeError: “parameter 1 is not of type “Element”.”

observe ResizeObserver.es.js:778 e ResizeObserver.es.js:916 value TextArea.js:148 value TextArea.js:122 br react-dom.production.min.js:229 gr react-dom.production.min.js:220 vr react-dom.production.min.js:219 pr react-dom.production.min.js:216 ir react-dom.production.min.js:214
Environment Info
antd 3.11.6
React 16.3.0-alpha.2
System windows10
Browser firefox 65.0.1

website id and password : kosasa33! open the website and click edit button.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
wufeng87commented, Jul 11, 2019

不好意思,是我们自己的问题。 应该基本确定问题了,是有全局加载的js覆盖掉了Window.Element,会导致这个判断通不过: if (!(target instanceof getWindowOf(target).Element)) {

Read more comments on GitHub >

github_iconTop Results From Across the Web

'observe' on 'MutationObserver': parameter 1 is not of type 'Node'
This error means that document.querySelectorAll(".no")[2] is not a Node . Most likely this means there isn't such an element; ...
Read more >
TypeError: More arguments needed - JavaScript | MDN
There is an error with how a function is called. More arguments need to be provided. Examples. Required arguments not provided. The Object....
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
TypeError - JavaScript - MDN Web Docs
A TypeError may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator...
Read more >
TypeError: can't assign to property "x" on "y": not an object
The problem might be that an unexpected value is flowing at an unexpected place, or that an object variant of a String or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found