Skip to content

[6.x] Fix error on CreateForm component in Storybook#14264

Merged
jasonvarga merged 1 commit into6.xfrom
storybook-create-form
Mar 16, 2026
Merged

[6.x] Fix error on CreateForm component in Storybook#14264
jasonvarga merged 1 commit into6.xfrom
storybook-create-form

Conversation

@duncanmcclean
Copy link
Member

This pull request fixes an issue where typing into the title input of a CreateForm component in Storybook throws an error: Cannot read properties of null (reading 'en').

This was happening because the Slug.js class expects Statamic.$config.get('charmap') to return an object, but the Storybook mock was returning null for unmocked config keys.

This PR fixes it by adding the missing config values (charmap, asciiReplaceExtraSymbols, and lang) to the Storybook preview configuration.

Reported on Discord

@duncanmcclean duncanmcclean changed the title [6.x] Add missing slug config keys [6.x] Fix error on CreateForm component in Storybook Mar 16, 2026
@jasonvarga jasonvarga merged commit 2eb1d42 into 6.x Mar 16, 2026
19 checks passed
@jasonvarga jasonvarga deleted the storybook-create-form branch March 16, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants