question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

errors only show up on build, fine otherwise

See original GitHub issue

Hi. These errors only show up on build.
Is there a way to bypass them? The project runs fine in dev

node_modules/vite-plugin-vue-layouts/client.d.ts:3:19 - error TS7010: 'setupLayouts', which lacks return-type annotation, implicitly has an 'any' return type.

3   export function setupLayouts(routes: RouteRecordRaw[])
                    ~~~~~~~~~~~~

node_modules/vite-plugin-vue-layouts/client.d.ts:8:19 - error TS7010: 'setupLayouts', which lacks return-type annotation, implicitly has an 'any' return type.

8   export function setupLayouts(routes: RouteRecordRaw[])
                    ~~~~~~~~~~~~

node_modules/vite-plugin-vue-layouts/client.d.ts:9:19 - error TS7010: 'createRouterLayout', which lacks return-type annotation, implicitly has an 'any' return type.

9   export function createRouterLayout(
                    ~~~~~~~~~~~~~~~~~~

node_modules/vite-plugin-vue-layouts/client.d.ts:10:46 - error TS2304: Cannot find name 'Component'.

10     resolve: (layoutName: string) => Promise<Component | { default: Component }>)
                                                ~~~~~~~~~

node_modules/vite-plugin-vue-layouts/client.d.ts:10:69 - error TS2304: Cannot find name 'Component'.

10     resolve: (layoutName: string) => Promise<Component | { default: Component }>)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
JohnCampionJrcommented, Aug 20, 2021

@gigioSouza Will get this merged this weekend, thank you!

1reaction
sougiovncommented, Aug 30, 2021

@CharlesOkwuagwu while the solution isn’t merged, you can do the same as I.

Create a file named vite-plugin-vue-layouts.d.ts in your projects root dir with the following content.

declare module 'layouts-generated' {
  import { RouteRecordRaw } from 'vue-router'
  export function setupLayouts(routes: RouteRecordRaw[]): RouteRecordRaw[]
}

declare module 'virtual:generated-layouts' {
  import { RouteRecordRaw } from 'vue-router'
  import { Component } from 'vue'
  export function setupLayouts(routes: RouteRecordRaw[]): RouteRecordRaw[]
  export function createRouterLayout(
    resolve: (layoutName: string) => Promise<Component | { default: Component }>): Promise<Component | { default: Component }>
}

And then in your tsconfig.json add "vite-plugin-vue-layouts.d.ts" to the include attribute.

...
    "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "vite-plugin-vue-layouts.d.ts"],
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio displaying errors even if projects build
If you have ReSharper, try emptying the ReSharper cache: In menu, ReSharper > Options > Environment > General > Clear Caches. and disabling...
Read more >
No errors displayed in the "Error List" (error list doesn't show ...
Possible fix or workaround: Make sure you use "Build + IntelliSense" in the Error List pane. When only "Build" is selected, no errors...
Read more >
There were build errors....... but it doesn't show any errors in ...
User-1289986997 posted. Hello all, I have a strange problem. I have been working on a website, and after finishing a page, I hit...
Read more >
Builds failing, but only indication is dashboard 'error' badge
The branch builds and runs locally (win 10, node 9 using bash for windows) in ~120 seconds with no errors. However, when deploying...
Read more >
Xcode 13.2 - Internal error : Miss… | Apple Developer Forums
Hi guys, just updated Xcode to 13.2 via Mac App Store. I installed the additional components, and my project won't compile anymore :...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found