You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "michaelkamphausen (via GitHub)" <gi...@apache.org> on 2023/09/28 20:43:37 UTC

[GitHub] [cordova-ios] michaelkamphausen opened a new pull request, #1374: (ios) fixes WASM MIME type error by specifying it in Info.plist template

michaelkamphausen opened a new pull request, #1374:
URL: https://github.com/apache/cordova-ios/pull/1374

   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   
   iOS
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   Fixes #1370 where WebAssembly cannot be loaded in iOS production build due to the error `"Unexpected response MIME type. Expected 'application/wasm'"`. The error causes a blank app screen and prevents any user interaction.
   
   ### Description
   <!-- Describe your changes in detail -->
   
   I added `UTExportedTypeDeclarations` to the Info.plist template file, specifying the expected MIME type for loading WASM files.
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   I modified my project's Info.plist file by adding the `UTExportedTypeDeclarations` key and value as shown in the commit, built and ran my project on the device, and verified that the app loads and is displayed as expected.
   
   The automated tests don't run on my macOS version as it does not match CordovaLibTests’s deployment target. I don't know how to get the tests running.
   
   ### Checklist
   
   - [ ] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [PR] fix: WASM MIME type error by specifying it in Info.plist template [cordova-ios]

Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu merged PR #1374:
URL: https://github.com/apache/cordova-ios/pull/1374


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] codecov-commenter commented on pull request #1374: (ios) fixes WASM MIME type error by specifying it in Info.plist template

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1374:
URL: https://github.com/apache/cordova-ios/pull/1374#issuecomment-1739988122

   ## [Codecov](https://app.codecov.io/gh/apache/cordova-ios/pull/1374?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   > Merging [#1374](https://app.codecov.io/gh/apache/cordova-ios/pull/1374?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f10ee32) into [master](https://app.codecov.io/gh/apache/cordova-ios/commit/a1f3acea0a59ca270769ff67ac7ff91fcae0d563?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (a1f3ace) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   ```diff
   @@           Coverage Diff           @@
   ##           master    #1374   +/-   ##
   =======================================
     Coverage   78.25%   78.25%           
   =======================================
     Files          15       15           
     Lines        1789     1789           
   =======================================
     Hits         1400     1400           
     Misses        389      389           
   ```
   
   
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Re: [PR] (ios) fixes WASM MIME type error by specifying it in Info.plist template [cordova-ios]

Posted by "mohammadrafigh (via GitHub)" <gi...@apache.org>.
mohammadrafigh commented on code in PR #1374:
URL: https://github.com/apache/cordova-ios/pull/1374#discussion_r1444530035


##########
templates/project/__PROJECT_NAME__/__PROJECT_NAME__-Info.plist:
##########
@@ -45,5 +45,25 @@
 		<string>UIInterfaceOrientationPortraitUpsideDown</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
+	<key>UTExportedTypeDeclarations</key>

Review Comment:
   Maybe it's optimistic, but it would be great if we could have a script to detect if the code is using WASM or not, then warn users to enable usage of WASM in config.xml. But for now this could be enough to somehow easily enable WASM support in config.xml. Putting all those config lines in config.xml is not a minimal way to enable WASM. Maybe a boolean preference like `EnableWASM` makes sense.
   
   `<preference name="EnableWASM" value="true" />`
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] michaelkamphausen commented on a diff in pull request #1374: (ios) fixes WASM MIME type error by specifying it in Info.plist template

Posted by "michaelkamphausen (via GitHub)" <gi...@apache.org>.
michaelkamphausen commented on code in PR #1374:
URL: https://github.com/apache/cordova-ios/pull/1374#discussion_r1340713601


##########
templates/project/__PROJECT_NAME__/__PROJECT_NAME__-Info.plist:
##########
@@ -45,5 +45,25 @@
 		<string>UIInterfaceOrientationPortraitUpsideDown</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
+	<key>UTExportedTypeDeclarations</key>

Review Comment:
   I like your idea of using `UTImportedTypeDeclarations` key instead! I tested it and I can confirm that it works as well.
   
   I understand there are differing views on whether loading WebAssembly code should be supported by default or only when needed.
   
   I would argue for making this a default because I assume quite a few developers will be unaware of the problem until it suddenly occurs in their Testflight or release build. The cause is not easy to find, because the problem does not seem to occur in debug builds, which makes debugging difficult. This could be confusing and will cost time. At the same time, I don't see any downside how the `UTImportedTypeDeclarations` entry could cause problems.
   
   Nevertheless, at least the documentation should point out the WASM loading error in release builds and explain how to fix it when needed using `config-file` in `config.xml`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-ios] dpogue commented on a diff in pull request #1374: (ios) fixes WASM MIME type error by specifying it in Info.plist template

Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue commented on code in PR #1374:
URL: https://github.com/apache/cordova-ios/pull/1374#discussion_r1340663989


##########
templates/project/__PROJECT_NAME__/__PROJECT_NAME__-Info.plist:
##########
@@ -45,5 +45,25 @@
 		<string>UIInterfaceOrientationPortraitUpsideDown</string>
 		<string>UIInterfaceOrientationLandscapeRight</string>
 	</array>
+	<key>UTExportedTypeDeclarations</key>

Review Comment:
   I'm curious if this also works if you use `UTImportedTypeDeclarations` as the key
   
   I don't think we want to declare all Cordova apps as owners of the WebAssembly file type by default, so `UTExportedTypeDeclarations` seems like it might be the wrong key to use. Even with that though, I think injecting this when needed using `config-file` in config.xml for your app is probably a better choice that unconditionally including this declaration in the template for all Cordova apps.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org