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

build command not reporting error with layouts #64

Open
jobearrr opened this issue May 26, 2024 · 5 comments
Open

build command not reporting error with layouts #64

jobearrr opened this issue May 26, 2024 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jobearrr
Copy link
Contributor

jobearrr commented May 26, 2024

On my Site definition, I had the layouts assigned like below:

var layouts = [
    BlogPost()
]

where BlogPost is a custom layout inheriting from ContentPage.

When I run the ignite build command, it finishes with the message ✅ Successfully built!, but I look at the Build/ folder and the contents using the BlogPost layout are not there.

I ran the executable scheme on Xcode and there I got an error Failed to find layout named BlogPost.

Should there be a difference between these two building options?
I think it would be nice to have the build command reporting that error which I got reported when running the executable scheme on Xcode.

@twostraws
Copy link
Owner

It looks like ignite build is swallowing that warning, which isn't great – we should fix that up.

In the meantime, I wonder if the problem is the type of layouts. Does it resolve the problem if changed to var layouts: [any ContentPage] = [?

NB: If you only have one layout, I think it's selected by default without needing to assign anything the Markdown.

@jobearrr
Copy link
Contributor Author

Yes, the problem was solved by specifying the type.

@twostraws
Copy link
Owner

Thank you! I'm going to leave this issue open because I think we should document this on the Ignite Samples site, so this is a great first issue for someone.

@twostraws twostraws added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 31, 2024
@jkaunert
Copy link

jkaunert commented Jun 3, 2024

Xcode autocomplete adds the type when you accept, FWIW.
layout_autocomplete

@twostraws
Copy link
Owner

Yes, but I don't think it's terribly clear to many people what the distinction is. I think we should definitely look to make this clear on IgniteSamples somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants