Set parcel workers to 0 to fix cache segfaults
Luke Karrys committed
Oct 20, 2023 at 18:05 UTC
d8890ac3d39ad960692591037c9d1dd4cbdc4de3
3 files changed
+9
-36
gatsby-config.js
+1
-1
@@ -61,7 +61,7 @@ module.exports = {
61
repositoryUrl: 'https://github.com/npm/documentation',
62
},
63
flags: {
64
- DEV_SSR: !!process.env.DEV_SSR,
64
+ DEV_SSR: !!process.env.GATSBY_DEV_SSR,
65
},
66
plugins: [
67
'gatsby-plugin-styled-components',
package.json
+8
-5
@@ -7,11 +7,14 @@
7
},
8
"private": true,
9
"scripts": {
10
- "develop": "./scripts/gatsby.sh develop",
11
- "develop:ssr": "DEV_SSR=true ./scripts/gatsby.sh develop",
12
- "build": "./scripts/gatsby.sh build --verbose --log-pages",
13
- "clean": "gatsby clean",
14
- "serve": "gatsby serve",
10
+ "//": "Fix for parcel segfaults",
11
+ "//": "https://github.com/parcel-bundler/parcel/issues/7702",
12
+ "gatsby": "PARCEL_WORKERS=0 gatsby",
13
+ "develop": "npm run gatsby -- develop",
14
+ "develop:ssr": "GATSBY_DEV_SSR=true npm run develop",
15
+ "build": "npm run gatsby -- build --verbose --log-pages",
16
+ "clean": "npm run gatsby -- clean",
17
+ "serve": "npm run gatsby -- serve",
18
"lint": "eslint \"**/*.js\"",
19
"postlint": "template-oss-check",
20
"template-oss-apply": "template-oss-apply --force",
scripts/gatsby.sh
deleted
-30
@@ -1,30 +0,0 @@
1
-
2
-#!/bin/bash
3
-
4
-ARGS=$@
5
-LOG_FILE=".gatsby-stderr.log"
6
-
7
-trap "rm -f $LOG_FILE" EXIT
8
-
9
-function run_with_args {
10
- gatsby $ARGS
11
-}
12
-
13
-function clean_and_run {
14
- rm -f $LOG_FILE
15
- gatsby clean
16
- run_with_args
17
-}
18
-
19
-run_with_args 2> $LOG_FILE
20
-CODE=$?
21
-
22
-if [ $CODE -ne 0 ]; then
23
- echo "Command failed with code $CODE and error logs:"
24
- cat $LOG_FILE
25
-
26
- if grep -iqE 'segmentation fault|mutex' $LOG_FILE; then
27
- echo "Cleaning caches and running again..."
28
- clean_and_run
29
- fi
30
-fi