Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web] WebView in production: Null check operator used on a null value #2192

Closed
2 tasks done
kevinpthorne opened this issue Jun 20, 2024 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@kevinpthorne
Copy link

  • I have read the Getting Started section
  • I have already searched for the same problem

Environment

Technology Version
Flutter version 3.19.3
Plugin version 6.0.0
Android version n/a
iOS version n/a
macOS version (host) 14.4.1
Xcode version n/a
Google Chrome version 124.0.6367.208 (arm64)

Device information: n/a

Description

Expected behavior: InAppWebView renders the iframe as it does in Flutter dev mode

Current behavior: No iframe rendered. Null check operator used on a null value with obfuscated stacktrace

Steps to reproduce

  1. Make a widget with
  @override
  Widget build(BuildContext context) {
    return InAppWebView(
      initialData: InAppWebViewInitialData(data: "hello world"),
    );
  }
  1. Run flutter run -d chrome -- verify it is functioning
  2. Run flutter build web
  3. Run some HTTP server in the build/web directory (e.g. python3 -m http.server --directory build/web 8002)
  4. Visit the different http server, observe error

Images

image

Stacktrace/Logcat

Null check operator used on a null value
main.dart.js:28785     at Object.aTi (http:https://localhost:8002/main.dart.js:25467:19)
main.dart.js:28785     at Object.aS7 (http:https://localhost:8002/main.dart.js:25461:26)
main.dart.js:28785     at TG.I (http:https://localhost:8002/main.dart.js:49797:10)
main.dart.js:28785     at Si.bi (http:https://localhost:8002/main.dart.js:75771:18)
main.dart.js:28785     at Si.kN (http:https://localhost:8002/main.dart.js:75747:9)
main.dart.js:28785     at Si.BR (http:https://localhost:8002/main.dart.js:75699:10)
main.dart.js:28785     at Si.YS (http:https://localhost:8002/main.dart.js:75700:18)
main.dart.js:28785     at Si.Ey (http:https://localhost:8002/main.dart.js:75745:11)
main.dart.js:28785     at Si.fc (http:https://localhost:8002/main.dart.js:75744:6)
main.dart.js:28785     at rd.vv (http:https://localhost:8002/main.dart.js:75612:3)
@kevinpthorne kevinpthorne added the bug Something isn't working label Jun 20, 2024
Copy link

👋 @kevinpthorne

NOTE: This comment is auto-generated.

Are you sure you have already searched for the same problem?

Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!

If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.

In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE] or ios WKWebView [MY ERROR HERE] keywords.

Following these steps can save you, me, and other people a lot of time, thanks!

@kevinpthorne
Copy link
Author

Any tips on decoding this stacktrace? That's where I am stuck currently

@kevinpthorne
Copy link
Author

Looks like this was a case of my browser or dart compiler caching things -- now I'm just working around flutter/flutter#86833' since I am serving HTML and CSS assets...on the web inappwebview (I know its weird)

Tips for posterity:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant