Skip to content

fix(nuxt): Use correct server output file path #13725

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

Merged
merged 3 commits into from
Sep 19, 2024

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Sep 19, 2024

Depending on the nitro preset, the build output changes. By using the serverDir option, the directory can be retrieved dynamically.

@s1gr1d s1gr1d force-pushed the sig/build-output-path-correction branch from e8ee328 to 7813a0a Compare September 19, 2024 09:40
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

LGTM! I guess we're implicitly testing this already in the e2e test with our current nitro preset, right?

const rootDirResolver = createResolver(nuxt.options.rootDir);
nitro.hooks.hook('close', async () => {
const rootDirResolver = createResolver(nitro.options.rootDir);
const serverDirResolver = createResolver(nitro.options.output.serverDir);
const source = rootDirResolver.resolve('.nuxt/dist/server/sentry.server.config.mjs');
Copy link
Member

Choose a reason for hiding this comment

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

In SolidStart, I can get the build directory via nitro.options.buildDir, does Nuxt's nitro config not have that exposed?

@s1gr1d
Copy link
Member Author

s1gr1d commented Sep 19, 2024

we're implicitly testing this already in the e2e test with our current nitro preset, right?

Sadly not, as the setup in the E2E test is still with the file in the public folder (the nft resolution did not work in the package.json). But I'll try to fix that problem in another PR.

Edit: Just tried it but our setup somehow confuses pnpm and the override/resolution is ignored. The version of nft is always 0.26 (not 0.27) in the lock file

For this PR, I tested every preset manually.

@s1gr1d s1gr1d merged commit 32f5f00 into develop Sep 19, 2024
101 checks passed
@s1gr1d s1gr1d deleted the sig/build-output-path-correction branch September 19, 2024 12:26
@s1gr1d s1gr1d self-assigned this Sep 19, 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.

3 participants