Skip to content

Use-PodeWebPages - Cannot index into a null array #671

Description

@icabraja

Hello, I have a problem with Use-PodeWebPages where I get an error "Cannot index into a null array".

Import-Module -Name Pode
Import-Module -Name Pode.Web

Start-PodeServer -ConfigFile "$PSScriptRoot\Config.psd1" -Threads 2 {
    $Config = Get-PodeConfig
    Use-PodeWebPages -Path "$PSScriptRoot\Pages"
    Use-PodeRoutes -Path "$PSScriptRoot\Routes"
    New-PodeLoggingMethod -Terminal | Enable-PodeErrorLogging -Levels @("Error", "Warning", "Informational")
    Add-PodeEndpoint -Address $Config.Address -Port $Config.Port -Protocol $Config.Protocol
    Use-PodeWebTemplates -Title "Dashboard" -Theme Dark
}

Pode version 2.12.1
Pode.Web version 0.8.3

Page example:

Add-PodeWebPage -Name "test" -Layouts @(
    New-PodeWebContainer -Content @(
        New-PodeWebTextbox -Name "test"
    )
)

Use-PodeRoutes works normally for routes. If I comment out Use-PodeWebPages and dot source the page ps1 file, it works normally.

Am I missing something?
Thank You!

Activity

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

    question ❔Further information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions