Skip to content

[Nuxt] Look for SDK init files in Nuxt layers #14345

Open
@jaap3

Description

Problem Statement

We use Nuxt layers to have a common base for multiple projects. After adding the @sentry/nuxt module and the client/server configuration files (sentry.*.config.ts) to the base layer I had a hard time figuring out why sourcemaps weren't uploaded and Sentry wasn't initialised in the applications based on this layer.

Only after diving into

if (clientConfigFile || serverConfigFile) {
and
export function findDefaultSdkInitFile(type: 'server' | 'client'): string | undefined {
I figured out that I had to put these files into the apps, as they wouldn't be found in the base layer.

After I did that things started working as expected (I also moved/duplicated the sentry config key from the base layer to the apps nuxt.config file, not sure if that was necessary).

Solution Brainstorm

Either somehow involve layers into the resolution of these init files, or cleary document that layer based configuration is not supported.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Package: nuxtIssues related to the Sentry Nuxt SDK

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions