Skip to content

Commit 93293b3

Browse files
committed
fix(nuxt): include sentry.config.client.ts in nuxt app types
1 parent 5aa7a53 commit 93293b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/nuxt/src/module.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ export default defineNuxtModule<ModuleOptions>({
7272
mode: 'client',
7373
order: 1,
7474
});
75+
76+
nuxt.hook('prepare:types', options => {
77+
// Add the sentry config file to the include array
78+
if (!options.tsConfig.include) {
79+
options.tsConfig.include = [];
80+
}
81+
82+
// Add type references for useRuntimeConfig in root files for nuxt v4
83+
options.tsConfig.include.push('../sentry.client.config.ts');
84+
});
7585
}
7686

7787
const serverConfigFile = findDefaultSdkInitFile('server', nuxt);

0 commit comments

Comments
 (0)