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
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
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;
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