You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is when I now run npx nx build mika-controlplane-fe --skip-nx-cache --verbose it tries to use the mika-app-fe/vite.config.ts instead of the mika-controlplane-fe/vite.config.ts. Both configs however required different vite environment variables, so that breaks the build.
Full output:
[Nx Vite TsPaths] Found tsconfig at /home/runner/work/mika-app-fe/mika-app-fe/tsconfig.base.json
[Nx Vite TsPaths] first parsed tsconfig: {
resultType: 'success',
configFileAbsolutePath: '/home/runner/work/mika-app-fe/mika-app-fe/tsconfig.base.json',
baseUrl: '.',
absoluteBaseUrl: '/home/runner/work/mika-app-fe/mika-app-fe',
paths: {},
addMatchAll: true
}
[Nx Vite TsPaths] Found tsconfig at /home/runner/work/mika-app-fe/mika-app-fe/tsconfig.base.json
[Nx Vite TsPaths] fallback parsed tsconfig: {
resultType: 'success',
configFileAbsolutePath: '/home/runner/work/mika-app-fe/mika-app-fe/tsconfig.base.json',
baseUrl: '.',
absoluteBaseUrl: '/home/runner/work/mika-app-fe/mika-app-fe',
paths: {},
addMatchAll: true
}
failed to load config from /home/runner/work/mika-app-fe/mika-app-fe/apps/mika-app-fe/vite.config.ts
NX Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it. See errors below.
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
An error occurred while processing files for the @nx/vite/plugin plugin.
- apps/mika-app-fe/vite.config.ts: You are missing the google maps API key in your .env file
Error: You are missing the google maps API key in your .env file
at /home/runner/work/mika-app-fe/mika-app-fe/apps/mika-app-fe/vite.config.ts:72:[11](https://github.com/mikaaccounting/mika-app-fe/actions/runs/12545768957/job/34980503144#step:6:12)
at loadConfigFromFile (file:///home/runner/work/mika-app-fe/mika-app-fe/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:66538:62)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async resolveConfig (file:///home/runner/work/mika-app-fe/mika-app-fe/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:66140:24)
at async buildViteTargets (/home/runner/work/mika-app-fe/mika-app-fe/node_modules/@nx/vite/src/plugins/plugin.js:1[13](https://github.com/mikaaccounting/mika-app-fe/actions/runs/12545768957/job/34980503144#step:6:14):29)
at async createNodesInternal (/home/runner/work/mika-app-fe/mika-app-fe/node_modules/@nx/vite/src/plugins/plugin.js:79:18)
at async /home/runner/work/mika-app-fe/mika-app-fe/node_modules/nx/src/project-graph/plugins/utils.js:10:27
at async Promise.all (index 0)
at async createNodesFromFiles (/home/runner/work/mika-app-fe/mika-app-fe/node_modules/nx/src/project-graph/plugins/utils.js:8:5)
at async Array.createNodesV2 (/home/runner/work/mika-app-fe/mika-app-fe/node_modules/@nx/vite/src/plugins/plugin.js:50:[20](https://github.com/mikaaccounting/mika-app-fe/actions/runs/12545768957/job/34980503144#step:6:21))
The You are missing the google maps API key in your .env file issue only is thrown in the mika-app-fe/vite.config.ts, but I am building the controlplane-version.
Workaround
I have found a workaround:
I moved the vite.config.ts to the project root level like this
I would expect that I can have a vite.config.ts within each of my apps, to specify specific vite build requirements, such as envs and that it then only uses the one that I am building
Current Behavior
I have the following project structure
apps/mika-app-fe/project.json
apps/mika-controlplane/project.json
The problem is when I now run
npx nx build mika-controlplane-fe --skip-nx-cache --verbose
it tries to use themika-app-fe/vite.config.ts
instead of themika-controlplane-fe/vite.config.ts
. Both configs however required different vite environment variables, so that breaks the build.Full output:
The
You are missing the google maps API key in your .env file
issue only is thrown in themika-app-fe/vite.config.ts
, but I am building thecontrolplane
-version.Workaround
I have found a workaround:
I moved the
vite.config.ts
to the project root level like thisand adapted the configs
apps/mika-app-fe/project.json
apps/mika-controlplane/project.json
Expected Behavior
I would expect that I can have a
vite.config.ts
within each of my apps, to specify specific vite build requirements, such as envs and that it then only uses the one that I am buildingGitHub Repo
No response
Steps to Reproduce
Unsure how to reproduce.
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
This happened only on CI for some reason.
The text was updated successfully, but these errors were encountered: