-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] [DDC] TypeError: Cannot read properties of undefined (reading 'new') #56498
Comments
Summary: The issue is a |
@Rexios80 Do you have any clues what is going on here? 🤔 |
What dart/flutter version? There might be some fixes that still aren't merged into stable. |
@Rexios80 im faced this:
|
Can you reproduce on flutter master? |
This also happens on master |
Is it the cascade that's causing the issue? |
Nope. Removing it doesn't help. |
You say this is a workaround: HttpClientAdapter makeHttpClientAdapter() {
final adapter = HttpClientAdapter() as BrowserHttpClientAdapter;
adapter.withCredentials = true;
return adapter;
} What about this fixes the issue if it's not removing the cascade? Is it the cast? |
Yes, creating the adapter like this and force cast it does work, it's not about the cascade. The workaround is to help people to achieve their goal. |
Which of the web environments are you experiencing this issue?
|
The DDC compiler. The built Web application does not run into the issue. |
I actually have this error in one of my projects now. Not sure how it took me this long to notice. The workaround provided by @AlexV525 does fix the issue. |
This is getting worse according to cfug/dio#2282 (comment) @nshahan @sigmundch Would you mind taking further investigations? |
This tracker is for issues related to:
We've split our Dio adapter with conditional imports. However, writing the caller in a specific way does not reference the correct constructor as I can tell.
Consider the example, running this on Flutter Web environment will unexpectedly throw
TypeError: Cannot read properties of undefined (reading 'new')
:main.dart
adapter.dart
adapter_io.dart
adapter_web.dart
Workaround
The text was updated successfully, but these errors were encountered: