You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the build, I encounter several TypeScript errors, specifically TS2502, TS2550, TS7022, and TS2339, only within the files of the auto form component. Notably, there are code errors related to the .toReversed() method in the dependencie.ts file. I set up the project from scratch following the documentation, but the issue persists. I also tried starting from a starter template to test, and I’m still facing the same problem. Here’s the error code:
> vue-tsc -b && vite build
src/components/ui/auto-form/AutoFormFieldBoolean.vue:12:7 - error TS7022: 'booleanComponent' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
12 const booleanComponent = computed(() => props.config?.component === 'switch' ? Switch : Checkbox)
~~~~~~~~~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:12:35 - error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
12 const booleanComponent = computed(() => props.config?.component === 'switch' ? Switch : Checkbox)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:16:40 - error TS2339: Property 'fieldName' does not exist on type '{}'.
16 <FormField v-slot="slotProps" :name="fieldName">
~~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:22:20 - error TS2339: Property 'booleanComponent' does not exist on type '{}'.
22 :is="booleanComponent"
~~~~~~~~~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:24:26 - error TS2339: Property 'disabled' does not exist on type '{}'.
24 :disabled="disabled"
~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:30:31 - error TS2339: Property 'config' does not exist on type '{}'.
30 <AutoFormLabel v-if="!config?.hideLabel" :required="required">
~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:30:61 - error TS2339: Property 'required' does not exist on type '{}'.
30 <AutoFormLabel v-if="!config?.hideLabel" :required="required">
~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:31:14 - error TS2339: Property 'config' does not exist on type '{}'.
31 {{ config?.label || beautifyObjectName(label ?? fieldName) }}
~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:31:31 - error TS2339: Property 'beautifyObjectName' does not exist on type '{}'.
31 {{ config?.label || beautifyObjectName(label ?? fieldName) }}
~~~~~~~~~~~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:31:50 - error TS2339: Property 'label' does not exist on type '{}'.
31 {{ config?.label || beautifyObjectName(label ?? fieldName) }}
~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:31:59 - error TS2339: Property 'fieldName' does not exist on type '{}'.
31 {{ config?.label || beautifyObjectName(label ?? fieldName) }}
~~~~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:35:30 - error TS2339: Property 'config' does not exist on type '{}'.
35 <FormDescription v-if="config?.description">
~~~~~~
src/components/ui/auto-form/AutoFormFieldBoolean.vue:36:12 - error TS2339: Property 'config' does not exist on type '{}'.
36 {{ config.description }}
~~~~~~
src/components/ui/auto-form/constant.ts:10:14 - error TS7022: 'INPUT_COMPONENTS' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
10 export const INPUT_COMPONENTS = {
~~~~~~~~~~~~~~~~
src/components/ui/auto-form/dependencies.ts:35:62 - error TS2550: Property 'toReversed' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
35 const [sourceLast, ...sourceInitial] = source.split('.').toReversed()
~~~~~~~~~~
src/components/ui/auto-form/dependencies.ts:36:84 - error TS2550: Property 'toReversed' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
36 const [_targetLast, ...targetInitial] = (dep.targetField as string).split('.').toReversed()
~~~~~~~~~~
src/components/ui/auto-form/dependencies.ts:39:70 - error TS2550: Property 'toReversed' does not exist on type 'string[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.
39 const [_currentLast, ...currentInitial] = fieldName.split('.').toReversed()
~~~~~~~~~~
src/components/ui/auto-form/interface.ts:27:3 - error TS2502: 'component' is referenced directly or indirectly in its own type annotation.
27 component?: keyof typeof INPUT_COMPONENTS | Component
~~~~~~~~~
Found 18 errors.
This error only occurs when using IOS (every browser) or Safari.
When using dependencies with DepenedencyType.SETS_OPTIONS. The below error appears:
Unhandled Promise Rejection: TypeError: source.split(".").toReversed is not a function. (In 'source.split(".").toReversed()', 'source.split(".").toReversed' is undefined)
Reproduction
https://stackblitz.com/edit/vitejs-vite-7lz8nd?file=src%2Flib%2Futils.js
Describe the bug
During the build, I encounter several TypeScript errors, specifically TS2502, TS2550, TS7022, and TS2339, only within the files of the auto form component. Notably, there are code errors related to the .toReversed() method in the dependencie.ts file. I set up the project from scratch following the documentation, but the issue persists. I also tried starting from a starter template to test, and I’m still facing the same problem. Here’s the error code:
System Info
Contributes
The text was updated successfully, but these errors were encountered: