pnp / modernization

All modernization tooling and guidance
http://aka.ms/sppnp-modernize
MIT License
156 stars 86 forks source link

[BUG] - ConvertTo-PnPPage fails whenever the page being converted contains images #670

Closed msramanujam closed 1 month ago

msramanujam commented 2 months ago

Problem Area

[x] Page Transformation: Error during the use of page transformation from PnP PowerShell [ ] Page Transformation: Error during the use of page transformation from .Net [ ] Page Transformation: Page is not looking correct after transformation [ ] Modernization Scanner: something went wrong...

Expected or Desired Behavior

ConvertTo-PnPPage must convert the wiki page to a modern page.

Observed Behavior

Whenever ConvertTo-PnPPage is executed on a Wiki Page that contains images, the transformation fails with the error below: [Adding Web Parts to Target Page] Using 'Image' modern web part Error: [Summary] A critical error occurred - transformation did not complete Error: 'I' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0 | BytePositi onInLine: 495. StackTrace: at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at PnP.Core.Model.SharePoint.PageWebPart.set_PropertiesJson(String value) at PnP.Framework.Modernization.Transform.ContentTransformator.Transform(List1 webParts) at PnP.Framework.Modernization.Transform.PageTransformator.Transform(PageTransformationInformation pageTransformationInformation)

When I take the same wiki page & remove all images contained within it, the conversion proceeds without errors.

Steps to Reproduce

Execute ConvertTo-PnPPage on a wiki page containing images to reproduce the error.

pealmasa commented 1 month ago

There must be something else other than wiki page and image. I have tried reproduce it with wiki page with an image and conversion was ok.

msramanujam commented 1 month ago

We managed to find out that when the image being referred to hasn't been migrated yet, we ran into issues. So, we can go ahead & close this issue.

On Wed, Jul 10, 2024 at 12:25 AM Pedro Marques Santos < @.***> wrote:

There must be something else other than wiki page and image. I have tried reproduce it with wiki page with an image and conversion was ok.

— Reply to this email directly, view it on GitHub https://github.com/pnp/modernization/issues/670#issuecomment-2219753611, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKZPKJV25Z54R2CU23A7D3ZLTOVZAVCNFSM6AAAAABJAJN4YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJZG42TGNRRGE . You are receiving this because you authored the thread.Message ID: @.***>

-- Thanks Madhu Ramanujam (415)-794-3805

VesaJuvonen commented 1 month ago

Closing based on the comment from the original author of the issue.