Skip to content

TutorialLayout crashes rendering tutorials without optional featuredImage and authors fields #1006

@hxrshxz

Description

@hxrshxz

Most appropriate sections of the p5.js website?

Tutorials

What is your operating system?

Linux

Web browser and version

No response

Actual Behavior

When rendering a tutorial that doesn't include the optional featuredImage or authors fields in its frontmatter, the site crashes with:

Image

The component tries to access .src and .join() on undefined properties without checking if they exist first.

Expected Behavior

Tutorials without optional featuredImage or authors fields should render without errors. The layout should gracefully handle these optional fields being undefined.

Steps to reproduce

  1. Create a new tutorial file in en with frontmatter that omits featuredImage and authors:
title: My Tutorial
description: A test tutorial
category: introduction
  1. Start the dev server: npm run dev
  2. Navigate to /tutorials/my-tutorial/

Expected: Page renders normally
Actual: TypeError crash

Would you like to work on the issue?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions