1

This is my window.ts

import Vue from 'vue'

interface BrowserWindow extends Window {
  app: Vue
}

const browserWindow = window as BrowserWindow
export default browserWindow

I keep getting this error while compiling

TS2352: Conversion of type 'Window & typeof globalThis' to type 'BrowserWindow' may 
be a mistake because neither type sufficiently overlaps with the other. If this was intentional, 
convert the expression to 'unknown' first.
  Property 'app' is missing in type 'Window & typeof globalThis' but required in type 'BrowserWindow'.

1 Answer 1

3

As the error message describes, cast your windows to unknown and then to BrowserWindow:

const browserWindow = window as unknown as BrowserWindow
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.