Skip to content
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(nuxt): Use absolute path for client config #13798

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Sep 25, 2024

The buildDir can be changed in Nuxt and Adding the client config with a relative path worked so far as the buildDir in Nuxt v3 is /<rootDir>/.nuxt but the buildDir can be modified by the user and is also different in Nuxt v4 (/<rootDir>/node_modules/.cache/nuxt/.nuxt).

By using the absolute path, the client config can be injected correctly with all buildDir variations

@s1gr1d s1gr1d requested review from Lms24, a team and lforst and removed request for a team September 25, 2024 13:41
@@ -24,5 +24,5 @@ export function findDefaultSdkInitFile(type: 'server' | 'client'): string | unde

const filePath = filePaths.find(filename => fs.existsSync(filename));

return filePath ? path.basename(filePath) : undefined;
return filePath ? filePath : undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: doesn't find() already return undefined? If so we probably don't need the ternary here

@s1gr1d s1gr1d merged commit e5478ad into develop Sep 26, 2024
103 checks passed
@s1gr1d s1gr1d deleted the sig/init-file-path branch September 26, 2024 08:11
s1gr1d added a commit that referenced this pull request Oct 3, 2024
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