This is a migrated thread and some comments may be shown as answers.

DateTimePicker wrapper build failed

3 Answers 72 Views
Wrappers for React
This is a migrated thread and some comments may be shown as answers.
Parag
Top achievements
Rank 1
Parag asked on 22 Jan 2019, 02:14 AM

Hi,

 

 I have integrated DateTimePicker wrapper and build the project locally, it seems to be working fine.

 

However, we have automated process to generate build through Jenkins and when we tried to generate the build it throws attached error

 

Please help

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 22 Jan 2019, 08:08 AM
Hello, Parag,

Thank you for the details.

The error indicates an out of memory exception. This may occur if there is a code that makes a logic that goes into an endless loop.

Please share the DateTimePicker logic to check if there is such a case.

Also, please remove the DateTimePicker and try to build it on Jenkins to check if this is indeed caused by the component as the error does not refer directly to it.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Parag
Top achievements
Rank 1
answered on 23 Jan 2019, 01:18 AM

Hi Stefan,

 

 After removing code build works. Below is the code snippet

import React from "react";
import PropTypes from "prop-types";
import "@progress/kendo-ui";
import { DateTimePicker }
  from "@progress/kendo-dateinputs-react-wrapper";
import { isNullOrUndefined } from "util";
import { highlightControl } from "./helper/AnomalyHelper";
import { Common } from "./helper/Constants";
class DateTimePickerInput extends React.Component {
  constructor(props) {
    super(props);
    this.DateTimePickerInput = React.createRef();
  }
  focusDateTimePickerInput() {
    this.DateTimePickerInput.current.widgetInstance.
      element[Common.defaultCount].
      focus();
  }
  componentDidMount() {
    if (this.props.isActive === true) {
      this.focusDateTimePickerInput();
    }
  }
  componentDidUpdate() {
    if (this.props.isActive === true) {
      this.focusDateTimePickerInput();
    }
  }
  onChange = (event) => {
    const dateInput = event.sender.element[Common.defaultCount];
    if (!isNullOrUndefined(dateInput) && !isNullOrUndefined(dateInput.value)) {
      const date = new Date(dateInput.value).toDateString();
      if (date === "Invalid Date") {
        event.sender.element[Common.defaultCount].value = null;
      }
   
    }
  };
 
  render() {
    const {
        name,
        label,
        error,
        minDate,
        maxDate,
        fieldNo,
        id,
        hasLabel,
        hasField,
        onChange,
        ...rest
      } = this.props,
      wrapperClass = "form-group form-group-inline";
    let controlFieldLabelClass = "form-label-right",
      controlLabelClass = "form-label-left",
      cssClass = `${rest.className} form-control`,
      errorClass = "",
      iContainerClassName = "";
    if (!isNullOrUndefined(rest.errorCategory) && !rest.disabled) {
      errorClass = highlightControl(rest.errorCategory);
    }
    if (rest.focusedDate) {
      rest.focusedDate.trim();
      const yearMonthDate = rest.focusedDate.split(","),
        iFocusedDate = new Date(
          yearMonthDate[0],
          yearMonthDate[1] - 1,
          yearMonthDate[2]
        );
      rest.focusedDate = iFocusedDate;
    }
    if (rest.isChild && !rest.disabled && isNullOrUndefined(rest.value)) {
      errorClass = "date-highlight";
    }
    if (rest.disabled) {
      controlLabelClass += " disabled";
      controlFieldLabelClass += " disabled";
    }
    if (rest.containerClassName) {
      iContainerClassName = rest.containerClassName;
    }
    return (
      <div className={wrapperClass}>
       <div className="field">
          <div className={errorClass}>
            <DateTimePicker
              name={name}
              format={"MM/dd/yyyy HH:mm"}
              formatPlaceholder="formatPattern"
              parseFormats={"MM/dd/yyyy HH:mm"}
              className={cssClass}
              change={(ev) => this.onChange(ev)}
              ref={this.DateTimePickerInput}
               {...(isNullOrUndefined(minDate)
                 ? {}
                 : {min: minDate})}
               {...(isNullOrUndefined(maxDate)
                 ? {}
                 : { max: maxDate })}
              id={id}
              validityStyles={false}
              value={rest.value}
              {...rest}
            />
          </div>
        </div>
      </div>
    );
  }
}
DateTimePickerInput.propTypes = {
...
};
export default DateTimePickerInput;

0
Stefan
Telerik team
answered on 23 Jan 2019, 11:16 AM
Hello, Parag,

After more research, I noticed that this may occur if processing large data files, there are many issues with the over different project and all of them suggest setting a larger limit:

https://github.com/Chatie/wechaty/issues/1435

I can assume that it occurs only on the Jenkins as the machine that is running the build has different max size than the local machine. 

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Tags
Wrappers for React
Asked by
Parag
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Parag
Top achievements
Rank 1
Share this question
or