Skip to content

Setting Image.Source to local image (added as "Content" to Assets/ folder in UWP project) leads to WASM app never going past the Splashscreen #1

Closed

Description

@danielkornev

image

OS: Windows 10, 1709, x64
Machine: ThinkPad X1 Carbon 4th Gen, 16GB RAM, Intel Core i7 6th gen (6600), 0.5TB SSD
Visual Studio: 2017 Pro, v 15.6.7
Python 2.7.x installed

Activity

  1. danielkornev commented on May 7, 2018

    @danielkornev
    Author

    Ok, figured out what the problem is:

    If you add an image to UWP's Assets folder (or to any other location within the solution), and point image control's Source property to that image, an app would never complete loading.

  2. changed the title [-]Splashscreen is the only thing shown after launching WASM app[/-] [+]Setting Image.Source to local image (added as "Content" to Assets/ folder in UWP project) leads to WASM app never going past the Splashscreen[/+] on May 7, 2018
  3. carldebilly commented on May 8, 2018

    @carldebilly
    Member

    If you put the image in the UWP asset folder (in the UWP Head project), it won't be available for other heads.

    Is it possible for you to fork the repo and share a commit reproducing the problem? (or any other way to give us more information to reproduce it) I would love to fix the problem for you :-).

    (by the way, congrats, you're the first one to report a bug on this repo!)

  4. danielkornev commented on May 8, 2018

    @danielkornev
    Author
  5. jeromelaban commented on May 8, 2018

    @jeromelaban
    Member

    @danielkornev "local" files should be available in the wasm app if the build action is set to Content. It seems that for now, wasm does not support this properly, we'll fix it.

    Thanks for trying uno out !

  6. danielkornev commented on May 8, 2018

    @danielkornev
    Author
  7. miguelrochefort commented on May 8, 2018

    @miguelrochefort
    Contributor

    Also make sure to use the ms-appx URI scheme:

    <Image Source="ms-appx:///Assets/image.png" />
  8. MarkStega commented on May 22, 2018

    @MarkStega

    I can confirm that any reference to an image causes an error to be thrown during the load of that image. I tried both 'Source="/Assets/ImageName.png"' and 'Source="ms-appx:///Assets/ImageName.png"'. Both versions work in a UWP app; Neither work in wasm.

    The first few lines of the error from the console:

    mono.js:1 Error #1 "TypeError: Cannot read property 'toString' of undefined" executing javascript: "(function(t){document.title = t;})("Uno Playground");" put_char @ mono.js:1 mono.js:1 �[41m�[30mfail�[39m�[22m�[49m: Windows.UI.Core.CoreDispatcher[0] mono.js:1 Dispatcher unhandled exception mono.js:1 System.Exception: Failed to load Page Optimiser.NG.MainPage System.InvalidOperationException: This operation is not supported for a relative URI. mono.js:1 at System.Uri.get_Scheme () <0x1e38ba0 + 0x0001c> in <3d11b0248be143f5a11160eae8e61e3e>:0 mono.js:1 at Windows.UI.Xaml.Media.ImageSource.InitFromUri (System.Uri uri) <0x1e38a58 + 0x00010> in <c839eae4007e4ef3bcf083ab0250456d>:0 mono.js:1 at Windows.UI.Xaml.Media.Imaging.BitmapImage.OnUriSourceChanged (Windows.UI.Xaml.DependencyPropertyChangedEventArgs A_0) <0x1e4be58 + 0x00044> in <c839eae4007e4ef3bcf083ab0250456d>:0 mono.js:1 at Windows.UI.Xaml.Media.Imaging.BitmapImage+<>c.<.cctor>b__58_0 (Windows.UI.Xaml.DependencyObject s, Windows.UI.Xaml.DependencyPropertyChangedEventArgs e) <0x1e4be00 + 0x00024> in <c839eae4007e4ef3bcf083ab0250456d>:0 mono.js:1 at (wrapper delegate-invoke) <Module>.invoke_void_DependencyObject_DependencyPropertyChangedEventArgs(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.DependencyPropertyChangedEventArgs) mono.js:1 at Windows.UI.Xaml.PropertyMetadata.RaisePropertyChanged (Windows.UI.Xaml.DependencyObject source, Windows.UI.Xaml.DependencyPropertyChangedEventArgs e) <0x1c50dc0 + 0x0002c> in <c839eae4007e4ef3bcf083ab0250456d>:0

  9. jeromelaban commented on May 24, 2018

    @jeromelaban
    Member

    @MarkStega indeed, seems like a minor path parsing issue. Should be easy to fix :) Hang on for the source to be published.

  10. BeaumerF commented on Jun 25, 2018

    @BeaumerF

    I updated my nugget packages and it doesn't work for me on wasm (uwp yes).
    Source="ms-appx:///Assets/pictures/user.png"

  11. jeromelaban commented on Jun 27, 2018

    @jeromelaban
    Member

    @BeaumerF The package that fixed this was not published, you can try updating again, it should work better now.

  12. BeaumerF commented on Jun 27, 2018

    @BeaumerF

    @jeromelaban It still doesn't work on my project, the local images let the app on the splash screen (I updated, cleaned and built)

  13. 15 remaining items

  14. added a commit that references this issue on Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions