-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importScript Error while Drag and Drap New Text field #537
Comments
Thanks for sharing this issue. |
Is anyone working in this issue? |
PRs welcome! |
Yes sure @suman313 If you can resolve the issue. |
Hi @DivyarajsinhRana , |
Hi @suman313 , |
@brendanbond @suman313 It does not happen all the time. I can put 5 text fields on the form, and the 6th is causing that issue. |
Is this still reproducible in our latest versions? |
Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'https://cdn.form.io/ace/1.4.12/worker-json.js' failed to load.
Component
import React, { FC, useEffect, useState } from 'react'
import styles from './createNewFormBuilder.module.scss'
import { useLocation, useNavigate } from 'react-router-dom'
import { useAppDispatch, useAppSelector } from '../../../hooks'
import { requestGenerator } from '../../../utils/payloadGenerator'
import CreatedUsersPopup from '../../../components/common/created-users-popup/CreatedUsersPopup'
import { utcToDate } from '../../../utils/utils'
import Button from '../../../components/common/button/Button'
import {
DropDownIcon,
PolygonIcon,
} from '../../../components/common/svg-components'
import { FormBuilder, Form } from 'react-formio/lib/components'
import {
createNewForm,
updateCreateNewFormById,
} from '../../../redux/features/create-new-form/createNewFormAsynActions'
interface ICreateNewFormBuilder {}
const CreateNewFormBuilder: FC = () => {
/* Dependency to navigate between pages /
const navigate = useNavigate()
/ Dependency to navigate between pages */
/* Dependency to dispatch an action /
const dispatch = useAppDispatch()
/ Dependency to dispatch an action */
/* Dependency for form builder /
var selFormBuilderObj = {} // using a state variable and setting in handleFormBuilderChange was causing infinite loop issues so i have used var
const [formBuilderJson, setFormBuilderJson] = useState({
display: 'form',
components: [],
})
/ Dependency for form builder */
/* Selector to get the initial data of module from redux store*/
const {
isLoading,
createNewFormData,
createFormBuilderHeaderData,
isStatusUpdated,
} = useAppSelector((state) => state.createNewForm)
/* Selector to get the initial data of module from redux store*/
useEffect(() => {
/* Navigate back to list component if the following dependencies are not present /
if (
!createFormBuilderHeaderData.name ||
!createFormBuilderHeaderData.module_name ||
!createFormBuilderHeaderData.department_id
) {
navigate('/formBuilder')
}
/ Navigate back to list component if the following dependencies are not present */
}, [])
/* Function definition for form submission */
const onSubmit = () => {
if (
createFormBuilderHeaderData._id &&
createFormBuilderHeaderData._id !== '' &&
createFormBuilderHeaderData._id !== undefined &&
createFormBuilderHeaderData._id !== null
) {
const dataToBeSent = {
id: createFormBuilderHeaderData._id,
data: {
name: createFormBuilderHeaderData.name,
module_name: createFormBuilderHeaderData.module_name,
department_id: createFormBuilderHeaderData.department_id.value,
note: createFormBuilderHeaderData.note,
form: JSON.stringify({ ...selFormBuilderObj }),
},
}
}
/* Function definition for form submission */
/* Function definition for form builder - OnChange /
const handleFormBuilderChange = (schema: any) => {
console.log('schema', schema)
selFormBuilderObj = schema
}
/ Function definition for form builder - OnChange */
return (
<>
</>
)
}
export default CreateNewFormBuilder
The text was updated successfully, but these errors were encountered: