From 131a9e0ff8b6d1894e34bceb03513fe02adf26ec Mon Sep 17 00:00:00 2001 From: madogiwa <17684091+madogiwa0124@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:40:41 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=93=8C=20Fixed=20a=20type=20error?= =?UTF-8?q?=20on=20import=20of=20`App.vue`=20in=20sample=20code.=20(#236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As shown below, a type error TS2307 occurs when importing `App.vue` in the sample code. ```sh $ pnpm tsc --noEmit --project book/impls/10_minimum_example/070_sfc_compiler/plugin-sample/tsconfig.json book/impls/10_minimum_example/070_sfc_compiler/plugin-sample/src/main.ts:3:17 - error TS2307: Cannot find module './App.vue' or its corresponding type declarations. 3 import App from './App.vue' ~~~~~~~~~~~ Found 1 error in book/impls/10_minimum_example/070_sfc_compiler/plugin-sample/src/main.ts:3 ``` `App.vue` is written in javascript and has no type definitions, so `@ts-ignore` is added to ignore type checking. --- .../070_sfc_compiler/plugin-sample/src/main.ts | 1 + .../070_sfc_compiler2/examples/playground/src/main.ts | 1 + .../070_sfc_compiler3/examples/playground/src/main.ts | 1 + .../070_sfc_compiler4/examples/playground/src/main.ts | 1 + 4 files changed, 4 insertions(+) diff --git a/book/impls/10_minimum_example/070_sfc_compiler/plugin-sample/src/main.ts b/book/impls/10_minimum_example/070_sfc_compiler/plugin-sample/src/main.ts index ffa9c7fd..b95e6646 100644 --- a/book/impls/10_minimum_example/070_sfc_compiler/plugin-sample/src/main.ts +++ b/book/impls/10_minimum_example/070_sfc_compiler/plugin-sample/src/main.ts @@ -1,5 +1,6 @@ import { createApp } from 'vue' import './style.css' +// @ts-ignore import App from './App.vue' import './plugin.sample.js' diff --git a/book/impls/10_minimum_example/070_sfc_compiler2/examples/playground/src/main.ts b/book/impls/10_minimum_example/070_sfc_compiler2/examples/playground/src/main.ts index aaa1ab32..60693cc5 100644 --- a/book/impls/10_minimum_example/070_sfc_compiler2/examples/playground/src/main.ts +++ b/book/impls/10_minimum_example/070_sfc_compiler2/examples/playground/src/main.ts @@ -1,4 +1,5 @@ import { createApp } from 'chibivue' +// @ts-ignore import App from './App.vue' const app = createApp(App) diff --git a/book/impls/10_minimum_example/070_sfc_compiler3/examples/playground/src/main.ts b/book/impls/10_minimum_example/070_sfc_compiler3/examples/playground/src/main.ts index aaa1ab32..60693cc5 100644 --- a/book/impls/10_minimum_example/070_sfc_compiler3/examples/playground/src/main.ts +++ b/book/impls/10_minimum_example/070_sfc_compiler3/examples/playground/src/main.ts @@ -1,4 +1,5 @@ import { createApp } from 'chibivue' +// @ts-ignore import App from './App.vue' const app = createApp(App) diff --git a/book/impls/10_minimum_example/070_sfc_compiler4/examples/playground/src/main.ts b/book/impls/10_minimum_example/070_sfc_compiler4/examples/playground/src/main.ts index aaa1ab32..60693cc5 100644 --- a/book/impls/10_minimum_example/070_sfc_compiler4/examples/playground/src/main.ts +++ b/book/impls/10_minimum_example/070_sfc_compiler4/examples/playground/src/main.ts @@ -1,4 +1,5 @@ import { createApp } from 'chibivue' +// @ts-ignore import App from './App.vue' const app = createApp(App)