-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Update web_embedding
to new bootstrapping templates
#2297
Comments
@johnpryan is WASM support for that is on the table or should I open a separate issue once this issue is closed? I tried to update the
|
@parlough this is most likely related to the web_embedding demo using an "outdated" js-interop mechanism, compared to what's needed for WASM. (never attempted to compile this example to WASM, tbh!) |
@ditman it compiles fine, but fail at runtime. I wonder if there is a better way. My own app compiled to wasm seem to run in embedded element, but fail to get data from a rest service when running on a local httpd due to cors. Could really use some support in tools for that |
@ekuleshov It's hard to help without seeing the specific errors, but CORS errors should be independent from Wasm compilation, you should have the same issues when compiling to JS. |
@ditman my current workaround is to use the following command to get a Chrome browser instance with web security disabled
Then follow the Flutter WASM instructions to build and serve locally. Then use the above Chrome instance with disabled web security to open locally served WASM web app on The CORS-restricted resources usually give a generic error, like
|
@ekuleshov right, but you can't expect your users to disable web security for your app to work. I'd recommend that you ensure that the response for the resource you're downloading is allow-listing the domain of your web app to use CORS as intended. If enabling CORS for your app on the server-side is not enabled (maybe because you don't own the service), then you can either proxy, or fall back to |
@ditman that is exactly the issue I'm referring to. The external resource is configured with CORS and it disallow access from a web application with a localhost origin (i.e. served locally). There is no issue when web application is co-hosted there in production, but in dev/debugging environment the web application can't load these resources. I guess the dhttpd configuration to serve WASM locally is serving a similar purpose. And it is somewhat non-trivial to configure proxy and/or dns to make requests from a locally served web application (both WASM and JS) to match with the origin expected by CORS. I guess this discussion deviated from this specific issue... |
Haha yes, also you'd have the same issue with any other web stack, not just Flutter Web :P |
True to some extent. Yet Flutter is somewhat special with its |
Migrating the Angular sample is blocked on flutter/flutter#149443 Contributes to #2297.
No description provided.
The text was updated successfully, but these errors were encountered: