For my current project, I decided to integrate Vueforms into the codebase. However, when I pasted their installation code into both my .ts and .js files, I encountered errors during the import of vueformconfig and builderconfig.
This is a snippet of my main.ts file:
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import Vueform from '@vueform/vueform'
import vueformConfig from './../vueform.config'
import Builder from '@vueform/builder'
import builderConfig from './../builder.config'
const app = createApp(App)
app.use(Vueform, vueformConfig)
app.use(Builder, builderConfig)
app.mount('#app')
The TypeScript transpiler generated the following error messages:
src/main.ts:5:27 - error TS2307: Cannot find module './../vueform.config' or its corresponding type declarations.
src/main.ts:7:27 - error TS2307: Cannot find module './../builder.config' or its corresponding type declarations.
I've scoured various websites and forums in search of a solution but so far, no luck. I seem to be stuck at this point.
Edit:
My build tool of choice is Vite+Vue, and as per the requirements, I must utilize main.ts to set up the Vue app and make necessary imports like vueformconfig and builderconfig.
Edit 2:
To address the import statement issue, I attempted to modify the import statements for vueform.config and builder.config as follows:
import vueformConfig from './../vueform.config.ts'
import builderConfig from './../builder.config.ts'
This adjustment appeared to resolve the import statement problems, yet new errors surfaced at the app.use() lines.
const app = createApp(App)
app.use(Vueform, vueformConfig) //error1
app.use(Builder, builderConfig) //error2
app.mount('#app')
Error Message:
src/main.ts:11:9 - error TS2769: No overload matches this call.
Overload 1 of 2, '(plugin: Plugin<[any]>, options_0: any): App<Element>', gave the following error.
Argument of type 'typeof import("C:/Users/aryan/OneDrive/Documents/GitHub/spacious-forms/node_modules/@vueform/vueform/types/index")' is not assignable to parameter of type 'Plugin<[any]>'.
....
11 app.use(Vueform, vueformConfig)
~~~~~~~
...
Edit 2: In response to a query regarding project structure, here it is displayed below:
spacious-forms
|
|____vueform.config.ts
|
|____builder.config.ts
|
|____src
| |
| |__ main.ts