Skip to content

fix: Early-return from VitePluginService::init() for console requests (#31)#32

Open
aedan-umd wants to merge 2 commits into
nystudio107:develop-v5from
aedan-umd:fix/console-request-early-return
Open

fix: Early-return from VitePluginService::init() for console requests (#31)#32
aedan-umd wants to merge 2 commits into
nystudio107:develop-v5from
aedan-umd:fix/console-request-early-return

Conversation

@aedan-umd

@aedan-umd aedan-umd commented May 12, 2026

Copy link
Copy Markdown

Summary

Fix #31 by an early-return from VitePluginService::init() for console requests.

Without this, on Craft 5.9.21 and above: SEOmatic's Install migration throws The directory does not exist: when the bundle's sourcePath alias hasn't been registered yet.

Behavior change

Previously the inner CP/preview guard short-circuited on getIsConsoleRequest(), but execution then fell through to the getPublishedUrl() call regardless. After this change, all console requests bail out before that call, matching the behavior of the prior guard.

useForAllRequests = true paths are unaffected for web requests; console requests under that flag also now bail (they were previously broken on 5.9.21).

@aedan-umd
aedan-umd force-pushed the fix/console-request-early-return branch from 58d7bb3 to 3b74e82 Compare May 12, 2026 00:28
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.

VitePluginService::init() throws "The directory does not exist:" during console install on Craft 5.9.21+

1 participant