When trying to search for 'elForm' using the 'in' operator within the context of a "datetime" type, the error "Unable to find 'elForm' in undefined" occurs

I am attempting to implement a datepicker with time options from Element UI. I am encountering an issue within the ElementUI component. It functions correctly if the type option is set as date, but throws an error with datetime. Below is my code snippet and the error message.

import { cloneDeep } from 'lodash';

export default {
  name: 'actions',
  components: {},
  props: {
    data: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {
      indentData: {
        reported_at: '',
      },
    };
  },
  computed: {
    validToPickerOptions() {
      const endOfDay = new Date(new Date().setHours(23, 59, 59, 999));
      return {
        disabledDate(time) {
          return (time >= endOfDay);
        },
      };
    },
  },
  methods: {
    reportMarkReported() {
      console.log('this.indentData', this.indentData);
      this.$emit('save-report-release', this.indentData);
    },
  },
  created() {
    this.indentData = cloneDeep(this.data);
  },
};
<template>
  <div>
  <div class="action">
    <button @click="reportMarkReported">
      Submit
    </button>
  </div>
  <div>
    <el-date-picker
      v-model="indentData.reported_at"
      type="datetime"
      format="dd MMM 'yy hh:mm A"
      placeholder="Pick a Date"
      size="small"
    />
    </div>
  </div>
</template>

Upon clicking on the element, here is the error I am encountering

vue.esm.js?b66f:1741 TypeError: Cannot use 'in' operator to search for 'elForm' in undefined
    at resolveInject (vue.esm.js?efeb:4649:1)
    at initInjections (vue.esm.js?efeb:4619:1)
    at Vue._init (vue.esm.js?efeb:4710:1)
    at new VueComponent (vue.esm.js?efeb:5836:1)
    at createComponentInstanceForVnode (vue.esm.js?b66f:4310:1)
    at init (vue.esm.js?b66f:4131:1)
    at createComponent (vue.esm.js?b66f:5608:1)
    at createElm (vue.esm.js?b66f:5555:1)
    at createChildren (vue.esm.js?b66f:5682:1)
    at createElm (vue.esm.js?b66f:5584:1)
vue.esm.js?b66f:591 [Vue warn]: Error in nextTick: "TypeError: Cannot read properties of undefined (reading '$el')"
TypeError: Cannot read properties of undefined (reading '$el')
    at Vue.eval (element-ui.common.js?bc95:18396:1)
    at Array.eval (vue.esm.js?b66f:1837:1)
    at flushCallbacks (vue.esm.js?b66f:1758:1)

Answer №1

Success! After upgrading my element-ui to version 2.15, the issue was resolved. This bug has been addressed in the latest release.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How about: "Interactive web form featuring customizable options to determine which fields are shown?"

How can I design a dynamic web form that changes based on selected options? This form will include standard fields as well as customized fields depending on the user's previous selections. There are approximately 120 different combinations of forms p ...

"Create a smooth transition effect in CSS by fading out one div and fading in

I've set up a grid of buttons, and my goal is to have the grid fade out when a button is clicked, then fade in with a new div in its place. This involves animating opacity from 1 to 0 and vice versa while toggling the display:none property for content ...

Jest does not support util.promisify(setTimeout) functionality

While I understand there may be similar questions on SO, I believe mine is unique and hasn't been addressed in the current answers. I'm currently experimenting with testing a REST API in Express.JS. Below, you'll find a basic working exampl ...

Encountering difficulties when attempting to inject NotifierService into an Angular Service

I am attempting to incorporate Angular NotifierService into my service class so that I can display error notifications in case of any exceptions from the service side. I attempted to inject a bean of NotifierService in the constructor of my service class, ...

Encountered an error while trying to retrieve data from

Having trouble with file uploads to the S3 bucket using @aws-sdk/client-s3 library and encountering errors when uploading files larger than 70kbps: `TypeError: Failed to fetch at FetchHttpHandler.handle (fetch-http-handler.js:56:13) at PutObjectCommand ...

What is the best way to retrieve a previously used jQuery function?

The dynamic table I've created has the functionality to search, display search results in pagination, and auto-compute fields. This is how it works: Users search for their items in the search box If the search results are extensive, the system displ ...

Tips for retrieving a nested data value within an array

I am currently puzzled by the undefined error I encounter when attempting to access a value using dot notation. The following illustrates my point: My goal is to retrieve the value from within the nested object in the headline color array: ...

I'm unable to resolve all parameters for xxx -- unit testing using jest

I recently encountered an issue with a test in jest that is failing and displaying the following error message: Error: Can't resolve all parameters for LoginService: (?). at syntaxError (/Users/wilson.gonzalez/Desktop/proyecto_andes/external/npm/nod ...

A new module is unable to load Angular Material

Recently, I developed an Angular material module similar to a core module. import { NgModule} from '@angular import {MatCheckboxModule} from '@angular/material/checkbox'; @NgModule({ imports: [ MatCheckboxModule ], exports: [ ...

Collapsible tree visualization in D3 experiences erratic behavior while zooming

After spending a considerable amount of time grappling with this issue, I find myself stuck. My objective is to construct a d3 collapsible tree, but every time I attempt to zoom in, the tree shifts to position 0,0. I've come across other queries like ...

Issues with Angular ngroute: controllers are not functioning properly

In order to route my application with different themes on the same page, I plan to utilize the ngroute module. Here's an example of how I intend to achieve this: <html> <head> <title>Angular JS Views</title> ...

Activating the mousewheel effect exclusively on specific div sections, rather than the entire page

After researching mousewheel events in jQuery, I realize that my lack of knowledge may be hindering my ability to find useful answers. I am looking to create a mousewheel effect that is only triggered within a specific div called #scroller. Currently, I am ...

Working with an undefined object in jQuery

Currently, I am delving into the realm of creating MVC5 web pages utilizing JQuery and Ajax. As part of an exercise, I developed the following function: <script language="javascript"> $.get("GetCustomersByJson", null, BindData); function Bi ...

AngularJs Resource provides the functionality to pass optional parameters through the URL

Currently, I am utilizing this type of resource: var Products = $resource('companies/:companyId/products') However, the issue arises when I attempt to access the products from all companies via the URL companies/products. Instead of receiving the ...

The upload directory in KCFinder can be accessed and selected using a URL

Issue: While using the link to open kcfinder as defined in kcfinder, I encountered a problem. The link is intended to open kcfinder with the provided parameters: window.open('/kcfinder/browse.php?type=files&dir=files/public&subDi ...

Exploring the differences between detecting the XMLHttpRequest object in JavaScript and using the try

When it comes to determining browser support for AJAX, I typically rely on object detection like this: if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } ...

The eval() function does not run scripts from external sources with a src attribute

Instead of using eval() to execute all <script> tags after completely rewriting a div, I have encountered an issue. The following code snippet works for inline-scripts, but it doesn't have the same effect on external scripts like: <script sr ...

The tooltipShowDelay setting within AG Grid does not seem to be functioning as expected

Currently, I am utilizing AG Grid version 26.2 in conjunction with Vue 2. My objective is to eliminate the delay in rendering tooltips by setting tooltipShowDelay to 0 for an instantaneous display. Initially, the first render takes approximately ~2 secon ...

When executing store.sync() in ExtJS, all fields are passed

In the latest version of ExtJS (6.5.0), I have set up a Store and an editable grid panel: Ext.define('StateStore',{ extend: 'Ext.data.Store', alias: 'store.stateStore', storeId : 'StateStore', field ...

Is it possible for Nuxtjs/apollo to make apollo wait for other requests before initiating the query?

Is there a way to have Apollo wait for the result of one request to a third party before making either of two queries? Or should I manually add the appropriate query to Apollo after receiving the results? ...