5

I have upgraded my CRA project to use react-scripts 3.2.0 When I run npm run build I get the "Creating an optimized production build..." message, but then nothing happens, its just stuck forever.

Environment:

node: v12.13.1

npm: 6.12.1

Project details:

typescript, scss and scss modules

package.json

    "dependencies": {
        "@types/jest": "^24.0.11",
        "@types/node": "^11.13.4",
        "@types/react": "^16.8.13",
        "@types/react-dom": "16.8.4",
        "classnames": "^2.2.5",
        "mobx": "^3.6.2",
        "mobx-react": "^4.4.3",
        "node-sass": "^4.12.0",
        "react": "^16.8.6",
        "react-scripts": "^3.2.0",
    },
    "devDependencies": {
        "@typescript-eslint/eslint-plugin": "^2.6.1",
        "@typescript-eslint/parser": "^2.6.1",
        "babel-plugin-transform-decorators-legacy": "^1.3.4",
        "enzyme": "^3.7.0",
        "enzyme-adapter-react-16": "^1.6.0",
        "husky": "^3.0.9",
        "lint-staged": "^9.4.2",
        "prettier": "^1.19.1",
        "typescript": "^3.2.4"
    },

tsconfig.json

{
    "compilerOptions": {
        "outDir": "build/dist",
        "module": "esnext",
        "target": "es5",
        "lib": ["es2016", "dom"],
        "sourceMap": true,
        "allowJs": true,
        "jsx": "preserve",
        "moduleResolution": "node",
        "rootDir": "src",
        "forceConsistentCasingInFileNames": true,
        "noImplicitReturns": true,
        "noImplicitThis": false,
        "noImplicitAny": false,
        "strictNullChecks": false,
        "suppressImplicitAnyIndexErrors": true,
        "noUnusedLocals": false,
        "experimentalDecorators": true,
        "skipLibCheck": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "strict": true,
        "resolveJsonModule": true,
        "isolatedModules": true,
        "noEmit": true
    },
    "include": ["src"],
    "types": ["react"]
}

1
  • Did you ever figure this out? Commented Feb 14, 2020 at 17:56

1 Answer 1

8

This is most probably because of shortage of RAM. Build command requires much more RAM than you'd expect.

Sign up to request clarification or add additional context in comments.

5 Comments

we looking for answer but u just talk about RAM
Thanks instance upgraded (ram increased) now working fine...
@AlanYong , the answer is to increase your system's RAM :)
I see lots of answers adding suggestions like this, but what it's based on? I added -- --verbose to command line, it added a couple of lines of info, but still stuck on Creating an optimized production build.... How can I make it to be verbose instead of being stuck?
This is the right answer. I am using Colima as the docker engine on MacBook Pro. Increasing cpu/mem allocation fixed it. stackoverflow.com/questions/70271194/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.