Skip to content

Commit

Permalink
fix: 📌 Fixed a type error on import of App.vue in sample code. (#236)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
madogiwa0124 authored Jan 8, 2024
1 parent db5e45d commit 131a9e0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createApp } from 'vue'
import './style.css'
// @ts-ignore
import App from './App.vue'
import './plugin.sample.js'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createApp } from 'chibivue'
// @ts-ignore
import App from './App.vue'

const app = createApp(App)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createApp } from 'chibivue'
// @ts-ignore
import App from './App.vue'

const app = createApp(App)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createApp } from 'chibivue'
// @ts-ignore
import App from './App.vue'

const app = createApp(App)
Expand Down

0 comments on commit 131a9e0

Please sign in to comment.