Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Claushingebjerg 936 posts 2571 karma points
    Oct 10, 2022 @ 07:36
    Claushingebjerg
    0

    Paul Seals Youtube Part 14 - Block List Previews

    So i followed Pauls youtube guide how to get block lit previews up and running i v 10. Great tutorial. But for some reason i get an error no matter what i do.

        [10:20:07 ERR] Error rendering preview for a block
    System.ArgumentNullException: Value cannot be null. (Parameter 'type')
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, Object[] args)
       at Clean.Site.Controllers.BlockPreviewApiController.GetMarkupForBlock(BlockItemData blockData) in /Users/claushingebjerg/Downloads/Preview2/Clean.Site/Controllers/BlockPreviewApiController.cs:line 116
       at Clean.Site.Controllers.BlockPreviewApiController.PreviewMarkup(BlockItemData data, Int32 pageId, String culture) in /Users/claushingebjerg/Downloads/Preview2/Clean.Site/Controllers/BlockPreviewApiController.cs:line 94
    

    The only way to get it to work is downloading pauls demo project and running that. That works. But following the tutorial returns the above error. I have even tried installing a project, and the pulling pauls data with usync. and moving the necessary files and foldes from Pauls project. But still get the error.

    Any pointers to what i'm missing?

  • Dennis 75 posts 397 karma points MVP
    Oct 11, 2022 @ 14:30
    Dennis
    0

    Hi,

    I cannot give you any concrete pointers, but it appears that in BlockPreviewApiController.cs on line 116, you are making a call to Activator.CreateInstance and you're passing null to the type argument. I recommend using the debugger and see where the variable that you pass into that method comes from. You'll find more clues there.

    Kind regards, Dennis

  • Claushingebjerg 936 posts 2571 karma points
    Oct 11, 2022 @ 14:39
    Claushingebjerg
    0

    Yeah, thats the problem when a frontender copy/pastes code... Im not doing any of the above... It's code copied from the tutorial...

  • Huw Reddick 1702 posts 5999 karma points MVP c-trib
    Oct 11, 2022 @ 14:41
    Huw Reddick
    1

    The problem with the tutorial is that it does not pass any settings data so that will probably be your issue, there is a discussioon somewher on how to fix it, I'll dig out a link

  • Huw Reddick 1702 posts 5999 karma points MVP c-trib
    Oct 11, 2022 @ 14:42
Please Sign in or register to post replies

Write your reply to:

Draft