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

wasm MIME type is not supported #1370

Closed
3 tasks done
mohammadrafigh opened this issue Sep 1, 2023 · 1 comment · Fixed by #1374
Closed
3 tasks done

wasm MIME type is not supported #1370

mohammadrafigh opened this issue Sep 1, 2023 · 1 comment · Fixed by #1374

Comments

@mohammadrafigh
Copy link

Bug Report

Problem

What is expected to happen?

application/wasm should be returned as MIME type for wasm files from static file server in iOS.

What does actually happen?

wasm libraries not working due to this error:
"Unexpected response MIME type. Expected 'application/wasm'"

Information

Here is an MR to Ionic that might be helpful:
https://github.com/ionic-team/capacitor/pull/5585/files

and another one in capacitor:
ionic-team/capacitor#6675

Command or Code

Just try to install and use a wasm library and run the app on simulator.

Environment, Platform, Device

Version information

Cordova: Cordova CLI 12.0.0, Cordova ios 7.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@michaelkamphausen
Copy link
Contributor

michaelkamphausen commented Sep 28, 2023

I ran into the same problem with my project.
I find the Ionic PR helpful indeed. It can be applied to Cordova as well.

As a quick solution until #1374 is merged, the following code can be added to a project's config.xml at the <platform name="ios"> node. It ensures the necessary changes are inserted into the Info.plist file when the project is built, without the need to modify the local cordova-ios module:

<config-file parent="UTImportedTypeDeclarations" target="*-Info.plist">
    <array>
        <dict>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.data</string>
            </array>
            <key>UTTypeDescription</key>
            <string>WebAssembly</string>
            <key>UTTypeIdentifier</key>
            <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <string>wasm</string>
                <key>public.mime-type</key>
                <string>application/wasm</string>
            </dict>
        </dict>
    </array>
</config-file>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants