-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: emulate event.platform
during development even if route is undefined
#12513
fix: emulate event.platform
during development even if route is undefined
#12513
Conversation
🦋 Changeset detectedLatest commit: 1ec990b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
event.platform
even if route
is undefined
Co-authored-by: Tee Ming <[email protected]>
event.platform
even if route
is undefinedevent.platform
during development even if route is undefined
if (!event.platform && DEV && state.emulator?.platform) { | ||
event.platform = await state.emulator.platform({ config: {}, prerender: false }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benmccann is this what you meant in #11996 (comment) ? I suppose one more check we need to add is if we're currently rendering a fallback
Hi!, should this get merged? I manually change Kit's node_modules file, and this change really made it to work |
Co-authored-by: Tee Ming <[email protected]>
Co-authored-by: Tee Ming <[email protected]>
Thank you! Sorry this took so long to merge. |
This ought to fix #11996
Only if
DEV
, config is an empty object and prerender is set tofalse
so thatevent.platform
can be emulated.I believe this will improve the development experience by preventing 500 errors and allowing development to occur in a more local development environment similar to the production environment.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits