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 loadConfigFile from devkit rather than @nuxt/kit #22571

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Mar 28, 2024

When using @nuxt/kit to load nuxt.config.ts files, it can result in errors when used in conjunction with @nx/vite/plugin (and the loadConfigFile function from vite).

This PR switches to our own function from @nx/devkit, which we can guarantee plays nicely with @nx/cypress, @nx/playwright, and anything else that uses the same plugin.

Note: When we isolate each crystal plugin into their own worker, this issue should be resolved as well. However, this is a quicker fix with smaller impact.

Current Behavior

Errors can occur during graph construction when combining nuxt + vitest + playwright/cypress.

Expected Behavior

Errors should not occur during graph construction.

Related Issue(s)

Fixes #

Copy link

vercel bot commented Mar 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2024 9:36pm

@jaysoo jaysoo force-pushed the fix_nuxt_crystal branch 2 times, most recently from 416854a to e1ddf5f Compare March 28, 2024 20:51
@jaysoo jaysoo requested a review from Coly010 March 28, 2024 20:53
@jaysoo jaysoo force-pushed the fix_nuxt_crystal branch 2 times, most recently from 7d088cf to 43aacc7 Compare March 28, 2024 21:05
);
}
const buildOutputPath = normalizeOutputPath(nuxtBuildDir, projectRoot);
const buildOutputPath = normalizeOutputPath(
Copy link
Member Author

Choose a reason for hiding this comment

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

We actually only want to cache the .nuxt folder. This is consistent with Next.js where we cache only .next folder. Previously, this logic was to handle caching dist/<app> rather than just dist/<app>/.nuxt, but we've since moved the default buildDir back to within the project root anyway. We cannot cache the entire {projectRoot}, which includes source code.

Copy link
Contributor

@Coly010 Coly010 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jaysoo jaysoo merged commit ef81455 into master Mar 28, 2024
6 checks passed
@jaysoo jaysoo deleted the fix_nuxt_crystal branch March 28, 2024 21:46
Copy link

github-actions bot commented Apr 4, 2024

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants