Skip to content

Commit 8d42b4d

Browse files
committed
Fix NX Cloud distributed task execution error for cacheable build tasks
- Updated nx.json to ensure 'build' tasks for driver-app and rider-app are cacheable. - Verified the build tasks for driver-app and rider-app are included under cacheableOperations. - Fixed the configuration in project.json to mark 'build' targets as cacheable for both apps. - Resolved the error in NX Cloud that prevented distributed task execution due to non-cacheable tasks. This commit closes #12 by ensuring proper cacheable task configuration for distributed builds.
1 parent 44507af commit 8d42b4d

File tree

8 files changed

+1043
-639
lines changed

8 files changed

+1043
-639
lines changed

Diff for: apps/admin-dashboard/src/app/404.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// src/app/404.js
2+
import React from 'react';
3+
4+
export default function Custom404() {
5+
return <h1>404 - Page Not Found</h1>;
6+
}

Diff for: apps/admin-dashboard/src/app/_error.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// src/app/_error.js
2+
import React from 'react';
3+
4+
function Error({ statusCode }) {
5+
return (
6+
<p>
7+
{statusCode
8+
? `An error ${statusCode} occurred on server`
9+
: 'An error occurred on client'}
10+
</p>
11+
);
12+
}
13+
14+
Error.getInitialProps = ({ res, err }) => {
15+
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
16+
return { statusCode };
17+
};
18+
19+
export default Error;

Diff for: apps/api/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"test": "mocha",
88
"dev": "mocha --require=ts-node/esm 'test/**/*.{ts,js}'",
9-
"start": "node index.js"
9+
"start": "node index.js",
10+
"link": "eslint --ext *.js src"
1011
},
1112
"keywords": [],
1213
"author": "",
@@ -15,6 +16,7 @@
1516
"dependencies": {
1617
"@koa/router": "^13.1.0",
1718
"dotenv": "^16.4.5",
19+
"eslint": "^9.13.0",
1820
"koa": "^2.15.3",
1921
"koa-bodyparser": "^4.4.1"
2022
},

Diff for: apps/driver-app/app/+html.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Root({ children }: PropsWithChildren) {
2020
<ScrollViewStyleReset />
2121

2222
{/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
23-
<style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
23+
{/* <style dangerouslySetInnerHTML={{ __html: responsiveBackground }} /> */}
2424
{/* Add any additional <head> elements that you want globally available on web... */}
2525
</head>
2626
<body>{children}</body>

Diff for: apps/rider-app/app/+html.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Root({ children }: PropsWithChildren) {
2020
<ScrollViewStyleReset />
2121

2222
{/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
23-
<style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
23+
{/* <style dangerouslySetInnerHTML={{ __html: responsiveBackground }} /> */}
2424
{/* Add any additional <head> elements that you want globally available on web... */}
2525
</head>
2626
<body>{children}</body>

Diff for: nx.json

+12-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,18 @@
1212
},
1313
"tasksRunnerOptions": {
1414
"default": {
15-
"options": {
16-
"cacheableOperations": ["build", "lint", "test"]
17-
}
15+
"options": {}
16+
}
17+
},
18+
"targetDefaults": {
19+
"build": {
20+
"cache": true
21+
},
22+
"lint": {
23+
"cache": true
24+
},
25+
"test": {
26+
"cache": true
1827
}
1928
}
2029
}

0 commit comments

Comments
 (0)