Skip to content

fix: replace defineHandler with defineEventHandler#2102

Open
Sigmabrogz wants to merge 3 commits intosolidjs:mainfrom
Sigmabrogz:fix/h3-define-event-handler
Open

fix: replace defineHandler with defineEventHandler#2102
Sigmabrogz wants to merge 3 commits intosolidjs:mainfrom
Sigmabrogz:fix/h3-define-event-handler

Conversation

@Sigmabrogz
Copy link
Copy Markdown

Fixes #2101

h3 no longer exports defineHandler. It was replaced by defineEventHandler. This updates the import and usage in @solidjs/start so that the generated template is buildable.

Resolves an issue where npm init solid@latest generates an unbuildable template because h3 no longer exports defineHandler. defineEventHandler is the modern API.

Signed-off-by: Sigmabrogz <bnb1000bnb@gmail.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 13, 2026

Deploy Preview for solid-start-landing-page failed. Why did it fail? →

Name Link
🔨 Latest commit 6dc2af8
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/69c806e358ac790008eb296b

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 13, 2026

🦋 Changeset detected

Latest commit: 6dc2af8

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/start@2102
npm i https://pkg.pr.new/solidjs/solid-start/@solidjs/vite-plugin-nitro-2@2102

commit: 6dc2af8

@Sigmabrogz
Copy link
Copy Markdown
Author

I've added the changeset as requested.

@Sigmabrogz
Copy link
Copy Markdown
Author

Hi maintainers, I've added the changeset as requested. The PR is ready for review. Would appreciate a review when you have time. Thanks!

options: HandlerOptions | ((context: PageEvent) => HandlerOptions | Promise<HandlerOptions>) = {},
) {
const handler = defineHandler({
const handler = defineEventHandler({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason for this change? Is the old one deprecated?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the PR description says, H3 no longer exports defineHandler

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.

[Bug?]: npm init solid@latest generates a template that is unbuildable

3 participants