quasar-ts
quasar-ts copied to clipboard
Problems on build
Is anyone else having any trouble getting this code to build? I get all kinds of errors when running:
Failed to compile with 9 errors 09:47:38
error in C:\src\vue\quasar-ts\node_modules\vue-class-component\lib\declarations.d.ts
(6,33): error TS2702: 'Vue' only refers to a type, but is being used as a namespace here.
error in C:\src\vue\quasar-ts\node_modules\vue-router\types\router.d.ts
(4,35): error TS2304: Cannot find name 'Vue'.
error in C:\src\vue\quasar-ts\node_modules\vue-router\types\router.d.ts
(13,43): error TS2304: Cannot find name 'Vue'.
error in C:\src\vue\quasar-ts\node_modules\vue-router\types\router.d.ts
(19,8): error TS2304: Cannot find name 'Vue'.
error in C:\src\vue\quasar-ts\node_modules\vue-router\types\router.d.ts
(93,25): error TS2304: Cannot find name 'Vue'.
error in C:\src\vue\quasar-ts\node_modules\vue-router\types\vue.d.ts
(17,13): error TS2428: All declarations of 'ComponentOptions' must have identical type parameters.
error in C:\src\vue\quasar-ts\node_modules\vue-router\types\vue.d.ts
(17,40): error TS2304: Cannot find name 'Vue'.
error in C:\src\vue\quasar-ts\node_modules\vue\types\options.d.ts
(54,18): error TS2428: All declarations of 'ComponentOptions' must have identical type parameters.
error in ./src/router.ts
(8,40): error TS2345: Argument of type '{ routes: ({ path: string; component: typeof Index; } | { path: string; component: typeof Error40...' is not assignable to parameter of type 'RouterOptions | undefined'.
Type '{ routes: ({ path: string; component: typeof Index; } | { path: string; component: typeof Error40...' is not assignable to type 'RouterOptions'.
Types of property 'routes' are incompatible.
Type '({ path: string; component: typeof Index; } | { path: string; component: typeof Error404; })[]' is not assignable to type 'RouteConfig[] | undefined'.
Type '({ path: string; component: typeof Index; } | { path: string; component: typeof Error404; })[]' is not assignable to type 'RouteConfig[]'.
Type '{ path: string; component: typeof Index; } | { path: string; component: typeof Error404; }' is not assignable to type 'RouteConfig'.
Type '{ path: string; component: typeof Index; }' is not assignable to type 'RouteConfig'.
Types of property 'component' are incompatible.
Type 'typeof Index' is not assignable to type 'typeof "C:/src/vue/quasar-ts/node_modules/vue/types/index" | ComponentOptions<any, DefaultData<an...'.
Type 'typeof Index' is not assignable to type 'AsyncComponent<DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, Record<string, any>>'.
Type 'typeof Index' provides no match for the signature '(resolve: (component: Component<DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, Record<string, any>>) => void, reject: (reason?: any)
=> void): void | Promise<VueConstructor<Vue> | FunctionalComponentOptions<Record<string, any>, PropsDefinition<Record<string, any>>> | ThisTypedComponentOptionsWithArrayProps<Vue, DefaultData<Vue>, DefaultMethods<Vue>,
DefaultComputed, string> | ThisTypedComponentOptionsWithRecordProps<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, Record<string, any>> | EsModuleComponent>'.
From the looks of it, it seems Vue is not correctly installed
Besides that, this repository is no longer up-to-date with the latest version of Vue nor Quasar Framework. This repo has been merged into the typescript branch of quasarframework/quasar-template-default and I'm keeping that repository up-to-date with the latest versions.
To use it:
# install Quasar CLI if you don't have it already
$ npm install -g quasar-cli
# generate a project folder with the typescript template
$ quasar init @quasarframework/quasar-template-default#typescript my-project
$ cd my-project
$ npm install
$ npm run dev
I tried that, but get this error:
$ quasar init @quasarframework/quasar-template-default#typescript quasar-ts
Running command: vue init 'quasarframework/quasar-starter-kit' @quasarframework/quasar-template-default#typescript
Command vue init requires a global addon to be installed.
Please run yarn global add @vue/cli-init and try again.
app:init ⚠️ Something went wrong... Try running the "vue init" command above manually. +0ms
app:init Reasons for failure: Package @vue/cli and @vue/cli-init are not installed globally, specified template is unavailable or it failed to download. +3ms
I get the same error after installing @vue/cli (version 3.0.0) and @vue/cli-init.