Skip to content

react-scripts build gives error: "Failed to compile. Cannot read properties of undefined (reading 'pop')" on npm@10.2.0 node@v21.0.0 (using node:latest docker image) #13410

Open
@sudhirbits

Description

@sudhirbits

Describe the bug

react-scripts build gives error: "Failed to compile. Cannot read properties of undefined (reading 'pop')" on npm@10.2.0 node@v21.0.0 (using node:slim docker image).

react-scripts --max_old_space_size=4096 build
Creating an optimized production build...
Failed to compile.
Cannot read properties of undefined (reading 'pop')

Pls note that node:slim is v21 which was released 20-Oct. The same build runs fine when using node:20-slim which has npm@10.1.0 and node@v20.8.1

react-scripts --max_old_space_size=4096 build
Creating an optimized production build...
Compiled successfully.

Did you try recovering your dependencies?

Yes. Does not fix the issue.

Which terms did you search for in User Guide?

Not done.

Environment

(paste the output of the command here.)

Steps to reproduce

(Write your steps here:)

Expected behavior

(Write what you thought would happen.)

Actual behavior

0 verbose cli /usr/bin/node /usr/bin/npm
1 info using npm@10.2.1
2 info using node@v21.0.0
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 1ms
5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 0ms
6 timing config:load:builtin Completed in 0ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:file:/app/.npmrc Completed in 4ms
10 timing config:load:project Completed in 4ms
11 timing config:load:file:/root/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/usr/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:setEnvs Completed in 1ms
16 timing config:load Completed in 9ms
17 timing npm:load:configload Completed in 9ms
18 timing config:load:flatten Completed in 1ms
19 timing npm:load:mkdirpcache Completed in 5ms
20 timing npm:load:mkdirplogs Completed in 0ms
21 verbose title npm run build
22 verbose argv "run" "--loglevel" "verbose" "build"
23 timing npm:load:setTitle Completed in 0ms
24 timing npm:load:display Completed in 4ms
25 verbose logfile logs-max:10 dir:/root/.npm/_logs/2023-10-21T10_39_47_012Z-
26 verbose logfile /root/.npm/_logs/2023-10-21T10_39_47_012Z-debug-0.log
27 timing npm:load:logFile Completed in 6ms
28 timing npm:load:timers Completed in 0ms
29 timing npm:load:configScope Completed in 0ms
30 timing npm:load Completed in 40ms
31 silly logfile done cleaning log files
32 timing command:run Completed in 112018ms
33 verbose exit 1
34 timing npm Completed in 112088ms
35 verbose code 1

Reproducible demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions