Skip to content

Make +sentry config async with getGlobalContext()#212

Merged
brillout merged 4 commits intonitedani/vike-react-sentryfrom
copilot/sub-pr-201
Feb 11, 2026
Merged

Make +sentry config async with getGlobalContext()#212
brillout merged 4 commits intonitedani/vike-react-sentryfrom
copilot/sub-pr-201

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

Changed the +sentry configuration API to use async functions that call getGlobalContext() instead of receiving globalContext as a parameter, aligning with the pattern used in Vike's onHookCall.

Before:

export default (globalContext) => ({
  environment: globalContext.isProduction ? 'production' : 'development',
})

After:

import { getGlobalContext } from 'vike/server' // or 'vike/client'

export default async () => {
  const globalContext = await getGlobalContext()
  return {
    environment: globalContext.isProduction ? 'production' : 'development',
  }
}

Changes

  • Type definitions: Updated sentry config to accept () => SentryOptions | Promise<SentryOptions> instead of (globalContext) => SentryOptions
  • Implementation: Refactored config resolution to properly await async functions and fixed array mutation bug
  • Documentation: Added examples showing both dynamic async configuration with getGlobalContext() and static configuration

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 11, 2026 15:17
Co-authored-by: brillout <1005638+brillout@users.noreply.github.com>
Co-authored-by: brillout <1005638+brillout@users.noreply.github.com>
Co-authored-by: brillout <1005638+brillout@users.noreply.github.com>
@brillout brillout marked this pull request as ready for review February 11, 2026 15:21
Copy link
Contributor Author

Copilot AI commented Feb 11, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • vike.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add vike-react-sentry Make +sentry config async with getGlobalContext() Feb 11, 2026
Copilot AI requested a review from brillout February 11, 2026 15:22
@brillout brillout merged commit 84b81f6 into nitedani/vike-react-sentry Feb 11, 2026
7 checks passed
@brillout brillout deleted the copilot/sub-pr-201 branch February 11, 2026 15:25
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