GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(solid): Add Solid 2 entry with error boundary capture by chargome · Pull Request #26543 · getsentry/sentry-javascript

feat(solid): Add Solid 2 entry with error boundary capture #26543

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.

Sign up for GitHub

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

Merged
chargome merged 5 commits into develop from feat/solid-2-client
Nov 19, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

feat(solid): Add Solid 2 entry with error boundary capture #26543

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
edf9a65
test(solid): Fix Solid 2 e2e app boundary trigger and uncaught mechanism
chargome Nov 18, 2026
b5209ee
feat(solid): Add Solid 2 entry with error boundary capture
chargome Nov 18, 2026
49abb9b
test(solid): Run Solid 2 e2e tests against @sentry/solid/solid2
chargome Nov 18, 2026
5a5e27c
ref(solid): Remove redundant comment on Solid 2 getDefaultIntegrations
chargome Nov 19, 2026
c6f8ce3
test(solid): Remove Solid 2 error unit test covered by e2e
chargome Nov 19, 2026
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

2 changes: 1 addition & 1 deletion 2 dev-packages/e2e-tests/test-applications/solid-2/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test:assert": "pnpm test:prod"
},
"dependencies": {
"@sentry/browser": "file:../../packed/sentry-browser-packed.tgz",
"@sentry/solid": "file:../../packed/sentry-solid-packed.tgz",
"@solidjs/web": "^2.0.0",
"solid-js": "^2.0.0"
},
Expand Down
6 changes: 4 additions & 2 deletions 6 dev-packages/e2e-tests/test-applications/solid-2/src/App.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ export default function App() {
<button
id="caughtErrorBtn"
onClick={() => {
setThrownCount(thrownCount() + 1);
setActiveError(thrownCount());
// Solid 2 holds signal writes until the next flush, so read the new count from a local.
const next = thrownCount() + 1;
setThrownCount(next);
setActiveError(next);
}}
>
Throw error in boundary
Expand Down
2 changes: 1 addition & 1 deletion 2 dev-packages/e2e-tests/test-applications/solid-2/src/instrument.client.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as Sentry from '@sentry/browser';
import * as Sentry from '@sentry/solid/solid2';

Sentry.init({
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
Expand Down
6 changes: 2 additions & 4 deletions 6 dev-packages/e2e-tests/test-applications/solid-2/tests/errorboundary.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ function waitForBoundaryError(count: number) {
});
}

// Unskipped once `@sentry/solid/solid2` lands.
test.skip('captures an error caught by an Errored boundary', async ({ page }) => {
test('captures an error caught by an Errored boundary', async ({ page }) => {
const errorPromise = waitForBoundaryError(1);

await page.goto('/');
Expand All @@ -33,8 +32,7 @@ test.skip('captures an error caught by an Errored boundary', async ({ page }) =>
});
});

// Unskipped once `@sentry/solid/solid2` lands.
test.skip('captures a second error after the boundary is reset', async ({ page }) => {
test('captures a second error after the boundary is reset', async ({ page }) => {
const firstErrorPromise = waitForBoundaryError(1);

await page.goto('/');
Expand Down
6 changes: 3 additions & 3 deletions 6 dev-packages/e2e-tests/test-applications/solid-2/tests/errors.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect, test } from '@playwright/test';
import { waitForError } from '@sentry-internal/test-utils';

// Unskipped once `@sentry/solid/solid2` lands.
test.skip('captures an uncaught error', async ({ page }) => {
test('captures an uncaught error', async ({ page }) => {
const errorPromise = waitForError('solid-2', errorEvent => {
return !errorEvent.type && errorEvent.exception?.values?.[0]?.value === 'Error thrown from Solid 2 E2E test app';
});
Expand All @@ -17,7 +16,8 @@ test.skip('captures an uncaught error', async ({ page }) => {
type: 'Error',
value: 'Error thrown from Solid 2 E2E test app',
mechanism: {
type: 'auto.browser.global_handlers.onerror',
// Solid 2 attaches event handlers with `addEventListener`, which the browser SDK wraps.
type: 'auto.browser.browserapierrors.addEventListener',
handled: false,
},
},
Expand Down
16 changes: 14 additions & 2 deletions 16 packages/solid/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@
"types": "./tanstackrouter.d.ts",
"default": "./build/cjs/tanstackrouter.js"
}
},
"./solid2": {
"import": {
"types": "./build/types/solid2/index.d.ts",
"default": "./build/esm/solid2/index.js"
},
"require": {
"types": "./build/types/solid2/index.d.ts",
"default": "./build/cjs/solid2/index.js"
}
}
},
"publishConfig": {
Expand All @@ -61,7 +71,7 @@
"peerDependencies": {
"@solidjs/router": ">=0.13.4 <2.0.0-0",
"@tanstack/solid-router": "^1.132.27",
"solid-js": "^1.8.4"
"solid-js": "^1.8.4 || ^2.0.0"
},
"peerDependenciesMeta": {
"@solidjs/router": {
Expand All @@ -80,16 +90,18 @@
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/user-event": "^14.6.8",
"solid-js": "^1.9.18",
"solid-js-2": "npm:solid-js@^2.0.0",
"vite": "^8.3.6",
"vite-plugin-solid": "^2.11.6"
},
"scripts": {
"build": "pnpm run \"/^build:(transpile|types)$/\"",
"build:dev": "pnpm run build",
"build:transpile": "rolldown -c rollup.npm.config.mjs",
"build:types": "pnpm run build:types:core && pnpm run build:types:routers",
"build:types": "pnpm run build:types:core && pnpm run build:types:routers && pnpm run build:types:solid2",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:routers": "tsc -p tsconfig.routers-types.json",
"build:types:solid2": "tsc -p tsconfig.solid2-types.json",
"build:tarball": "pnpm pack",
"clean": "node ../../scripts/rm.mjs build coverage sentry-solid-*.tgz ./*.d.ts ./*.d.ts.map",
"lint:fix": "oxlint . --fix --type-aware",
Expand Down
2 changes: 1 addition & 1 deletion 2 packages/solid/rollup.npm.config.mjs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollu

export default makeNPMConfigVariants(
makeBaseNPMConfig({
entrypoints: ['src/index.ts', 'src/solidrouter.ts', 'src/tanstackrouter.ts'],
entrypoints: ['src/index.ts', 'src/solidrouter.ts', 'src/tanstackrouter.ts', 'src/solid2/index.ts'],
}),
);
25 changes: 25 additions & 0 deletions 25 packages/solid/src/solid2/errors.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { captureException, defineIntegration } from '@sentry/core';
import { configureClientErrors } from 'solid-js';

const INTEGRATION_NAME = 'SolidErrors';

/**
* Captures errors that a Solid `<Errored>` boundary catches and renders a fallback for.
* Errors no boundary catches are already captured by the browser SDK's global handlers.
*/
export const solidErrorsIntegration = defineIntegration(() => {
return {
name: INTEGRATION_NAME,
setup() {
configureClientErrors({
onError(error, { ownerPath, boundaryPath }) {
captureException(error, {
mechanism: { type: 'auto.function.solid.error_boundary', handled: true },
// Solid only fills in component names on its observe and dev builds.
captureContext: { contexts: { solid: { owner_path: ownerPath, boundary_path: boundaryPath } } },
Comment thread
chargome marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

});
},
});
},
};
});
4 changes: 4 additions & 0 deletions 4 packages/solid/src/solid2/index.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from '@sentry/browser';

export { init, getDefaultIntegrations } from './sdk';
export { solidErrorsIntegration } from './errors';
23 changes: 23 additions & 0 deletions 23 packages/solid/src/solid2/sdk.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { BrowserOptions } from '@sentry/browser';
import { getDefaultIntegrations as getBrowserDefaultIntegrations, init as browserInit } from '@sentry/browser';
import type { Client, Integration } from '@sentry/core';
import { applySdkMetadata } from '@sentry/core';
import { solidErrorsIntegration } from './errors';

/**
* Initializes the Solid SDK for Solid 2.
*/
export function init(options: BrowserOptions): Client | undefined {
const opts = {
defaultIntegrations: getDefaultIntegrations(options),
...options,
};

applySdkMetadata(opts, 'solid');
Comment thread
chargome marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread
chargome marked this conversation as resolved.
Resolved

Uh oh!

There was an error while loading. Please reload this page.


return browserInit(opts);
}

export function getDefaultIntegrations(options: BrowserOptions): Integration[] {
return [...getBrowserDefaultIntegrations(options), solidErrorsIntegration()];
}
13 changes: 13 additions & 0 deletions 13 packages/solid/src/solid2/tsconfig.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../../../tsconfig.json",

"include": ["./**/*"],

"//": "The rest of the package uses solid-js 1.x. The Solid 2 entry resolves solid-js to the 2.x dev dependency alias.",
"compilerOptions": {
"lib": ["DOM", "es2020"],
"paths": {
"solid-js": ["../../node_modules/solid-js-2/types/index.d.ts"]
}
}
}
40 changes: 40 additions & 0 deletions 40 packages/solid/test/solid2/sdk.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { SDK_VERSION } from '@sentry/browser';
import * as SentryBrowser from '@sentry/browser';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { init } from '../../src/solid2';

const browserInit = vi.spyOn(SentryBrowser, 'init');

describe('init', () => {
beforeEach(() => {
vi.clearAllMocks();
});

it('sets the SDK metadata', () => {
init({ dsn: 'https://[email protected]/1337' });

expect(browserInit).toHaveBeenCalledTimes(1);
expect(browserInit).toHaveBeenLastCalledWith(
expect.objectContaining({
_metadata: {
sdk: {
name: 'sentry.javascript.solid',
packages: [{ name: 'npm:@sentry/solid', version: SDK_VERSION }],
version: SDK_VERSION,
settings: { infer_ip: 'auto' },
},
},
}),
);
});

it('adds solidErrorsIntegration to the default integrations', () => {
init({ dsn: 'https://[email protected]/1337' });

expect(browserInit).toHaveBeenLastCalledWith(
expect.objectContaining({
defaultIntegrations: expect.arrayContaining([expect.objectContaining({ name: 'SolidErrors' })]),
}),
);
});
});
9 changes: 9 additions & 0 deletions 9 packages/solid/test/solid2/tsconfig.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../src/solid2/tsconfig.json",

"include": ["./**/*"],

"compilerOptions": {
"types": ["vite/client"]
}
}
3 changes: 3 additions & 0 deletions 3 packages/solid/tsconfig.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

"include": ["src/**/*"],

"//": "The Solid 2 entry type-checks against solid-js 2.x in src/solid2/tsconfig.json",
"exclude": ["src/solid2"],

"compilerOptions": {
"lib": ["DOM", "es2020"]
}
Expand Down
14 changes: 14 additions & 0 deletions 14 packages/solid/tsconfig.solid2-types.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./src/solid2/tsconfig.json",

"compilerOptions": {
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"outDir": "build/types",
"rootDir": "./src"
},

"//": "Built separately from tsconfig.types.json because it resolves solid-js to 2.x",
"include": ["src/solid2/**/*"]
}
3 changes: 3 additions & 0 deletions 3 packages/solid/tsconfig.test.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

"include": ["test/**/*", "vite.config.ts"],

"//": "Solid 2 tests type-check against solid-js 2.x in test/solid2/tsconfig.json",
"exclude": ["test/solid2"],

"compilerOptions": {
// should include all types from `./tsconfig.json` plus types for all test frameworks used
"types": ["vite/client", "@testing-library/jest-dom"],
Expand Down
2 changes: 1 addition & 1 deletion 2 packages/solid/tsconfig.types.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
},

"//": "This is built separately in tsconfig.routers-types.json",
"exclude": ["src/solidrouter.ts", "src/tanstackrouter.ts"]
"exclude": ["src/solidrouter.ts", "src/tanstackrouter.ts", "src/solid2"]
}
36 changes: 33 additions & 3 deletions 36 packages/solid/vite.config.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -1,10 +1,40 @@
import { fileURLToPath } from 'node:url';
import solidPlugin from 'vite-plugin-solid';
import { defineConfig } from 'vitest/config';
import baseConfig from '../../vite/vite.config';

export default {
export default defineConfig({
...baseConfig,
plugins: [solidPlugin({ hot: !process.env.VITEST })],
test: {
...baseConfig.test,
projects: [
{
extends: true,
plugins: [solidPlugin({ hot: !process.env.VITEST })],
test: {
name: 'solid',
include: ['test/*.test.{ts,tsx}'],
},
},
{
extends: true,
// `solid-js` is a 1.x dev dependency, so Solid 2 is installed under the `solid-js-2` alias.
// Point at its browser production build: Vitest would otherwise pick the non-reactive server build.
resolve: {
alias: [
{
find: /^solid-js$/,
replacement: fileURLToPath(new URL('./node_modules/solid-js-2/dist/solid.js', import.meta.url)),
},
],
},
test: {
name: 'solid2',
environment: 'jsdom',
include: ['test/solid2/**/*.test.ts'],
typecheck: { tsconfig: './test/solid2/tsconfig.json' },
},
},
],
},
};
});
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.