-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Flutter Web crashes with TypeError: Cannot set properties of undefined (setting 'nativeCommunication') #1468
Comments
👋 @Binozo 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 Following these steps can save you, me, and other people a lot of time, thanks! |
I am stupid |
@Binozo What's the solution? |
@ayushkadbe my Problem was not related with the package. I made a rollback to the latest stable release (5.x.x). But the error was caused by an crash of my code in my application |
I have same problem on flutter_inappwebview: ^6.0.0-beta.22. TypeError: Cannot set properties of undefined (setting 'nativeCommunication') TypeError: Cannot set properties of undefined (setting 'nativeCommunication') packages/flutter_inappwebview/src/web/web_platform.dart 33:5 registerWith web_plugin_registrant.dart 23:34 registerPlugins web_entrypoint.dart 27:24 dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 367:37 _checkAndCall |
For me - updating the index.html was necessary, make sure to add
to the web/index.html file (in the section). |
+1 |
OK, I use it to work. |
it works for me, thank you! |
If someone is still facing this issue and is depending on the version 6.0.0-beta.30 or later Add this line in the <script
type="application/javascript"
src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js"
defer
></script> |
Small note: make sure you have placed above solution in the end of |
Thanks a lot |
Its not working for me. Please help |
it works for me, 10q |
It works for me too, just paste it before |
One big problem with this code snippet, its dissapear every time in index.html after flutter clean command |
can you give me an example for where should I place this code |
make sure to add the line in |
I did that but it's not working for me |
No, it is not. What exact issue are you facing? Is the screen going blank on launch? |
I added some screenshots of my issue could you check that |
for me,when i met this problem by added pakage, Example: flutter_inappwebview_web: ^1.0.8 and aba_payment: ^0.0.3 etc, becuase when i build web application ,i imported many package, like this i met it by pakage floor pakage |
@mirza-d3x which version of flutter_inappwebview_web are you using? |
Version 6.0.0 |
|
I added this tag but it's not working |
Can you send a screenshot of Browser's console while running the app? |
Rejecting promise with error: TypeError: Cannot set properties of undefined (setting 'nativeCommunication') |
same Rejecting promise with error: TypeError: Cannot set properties of undefined (setting 'nativeCommunication') |
change this to this add/edit this script in web/index.html
|
` <script defer src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js" type="application/javascript" ></script>
This is my index.html file This is the Log Launching lib/main.dart on Chrome in debug mode... |
Thanks! Here's the change for version >= 6.0.0 in the official docs: https://inappwebview.dev/docs/intro/#setup-web |
When i run the code in loclhost it is working fine but after giving the development its giving same error main.dart.js:4086 Uncaught TypeError: Cannot set properties of undefined (setting 'nativeCommunication') |
make sure you have added this package first in pubspec.yaml |
<script
type="application/javascript"
src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js"
defer
></script>
|
<script type="application/javascript" src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js" defer ></script>
this is working Thank you |
Okays
…On Sun, Apr 14, 2024 at 5:02 PM RAVI SHANKAR P ***@***.***> wrote:
<script type="application/javascript"
src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js"
defer ></script>
this is working Thank you
—
Reply to this email directly, view it on GitHub
<#1468 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBWDIDMHNADG7GRBKXVPSWDY5JSODAVCNFSM6AAAAAAS25ZN4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJUGAYTQMJXGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I vist here more than I'd like to admit. So I'm just going to copy-paste what worked for me.
|
Great!
…On Fri, May 24, 2024 at 4:57 PM Bijay Kumar Pun ***@***.***> wrote:
I vist here more than I'd like to admit. So I'm just going to copy-paste
what worked for me.
<script
type="application/javascript"
src="assets/packages/flutter_inappwebview_web/assets/web/web_support.js"
defer
></script>
—
Reply to this email directly, view it on GitHub
<#1468 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBWDIDIRT4EGFZME2H7XPMLZD4PZ3AVCNFSM6AAAAAAS25ZN4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRZGI4TOMRRGY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thanks! |
I get the same error on version 6.0.0 (and flutter_inappwebview_web 1.0.8), tried updating the index.html with the above I see three instances of web_support.js in my project's folder, all in the "build" folder, e.g. <my_project_folder>/build/flutter_assets/packages/flutter_inappwebview_web/assets/web/web_support.js Any other ideas? |
Bump, I currently have the same issue with those versions |
<script type="application/javascript"
src="/assets/packages/flutter_inappwebview_web/assets/web/web_support.js"
defer ></script>
using this
…On Mon, Jul 22, 2024 at 6:25 PM Robin Westerik ***@***.***> wrote:
I get the same error on version 6.0.0 (and flutter_inappwebview_web
1.0.8), tried updating the index.html with the above script element, as
the last part of the <head> element, and still get the same error.
I see three instances of web_support.js in my project's folder, all in the
"build" folder, e.g.
<my_project_folder>/build/flutter_assets/packages/flutter_inappwebview_web/assets/web/web_support.js
Any other ideas?
Bump, I currently have the same issue with those versions
—
Reply to this email directly, view it on GitHub
<#1468 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBWDIDJQBSM2YXQZ5SYT4J3ZNT6KRAVCNFSM6AAAAAAS25ZN4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBSHA4TAMBRGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Workaround if you're still having problems: Remove
"If the defer attribute is set, it specifies that the script is downloaded in parallel to parsing the page, and executed after the page has finished parsing." (https://www.w3schools.com/tags/att_script_defer.asp) Solution for the dev team: use some kind of event triggered by web_support.js script to set |
I was looking for this for months... for me it worked well in debugger or on local
How I found this out:
After fixing |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
Environment
Device information: Microsoft Edge 108.0.1462.46 and Firefox 107
Description
Expected behavior:
Normal application startup on Flutter Web
Current behavior:
Application doesn't start, loads forever.
Steps to reproduce
Stacktrace/Logcat
The text was updated successfully, but these errors were encountered: