Scenario:
In the h5 of the app, the app injected a global window object to interact with the page in the webview, and an error was reported when it was packaged.
Solution:
method one:
(window as any).xxx
Change window.jigsaw.init(()); directly in the component to (window as any).jigsaw.init(());
Method Two:
declare global {
interface Window {xxx: any;}
}
window.xxx = window.xxx|| {};
Method three:
interface MyWindow extends Window {
xxx(): void;
}
declare var window: MyWindow;
Similar Posts:
- Troubleshooting of typescript extended global window error
- [Five Method to Solve] android webpage err_unknown_url_scheme
- Android WebView monitors and rewrites window.history.go (- 1) method call
- [Solved] Cannot make a static reference to the non-static field logMongoTemplate
- Error: jest not implemented window.open() [How to Solve]
- How to Solve the window flicker problem caused by AWT components
- window.location.href/replace/reload()
- How to deal with the error “cannot read property ‘set state’ of undefined” in react
- Vue adds route errors dynamically: Uncaught Error… [How to Solve]
- [Solved] Spring introduces the properties variable Error: org.springframework.beans.TypeMismatchException…