-
Notifications
You must be signed in to change notification settings - Fork 101
Description
Environment information
System:
OS: Windows 11 10.0.26200
CPU: (16) x64 AMD Ryzen 7 5700U with Radeon Graphics
Memory: 43.97 GB / 63.38 GB
Binaries:
Node: 22.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: undefined - undefined
npm: 11.4.2 - C:\Program Files\nodejs\npm.CMD
pnpm: undefined - undefined
NPM Packages:
@aws-amplify/auth-construct: 1.8.1
@aws-amplify/backend: 1.16.1
@aws-amplify/backend-ai: Not Found
@aws-amplify/backend-auth: 1.7.1
@aws-amplify/backend-cli: 1.8.0
@aws-amplify/backend-data: 1.6.1
@aws-amplify/backend-deployer: 2.1.3
@aws-amplify/backend-function: 1.14.1
@aws-amplify/backend-output-schemas: 1.7.0
@aws-amplify/backend-output-storage: 1.3.1
@aws-amplify/backend-secret: 1.4.0
@aws-amplify/backend-storage: 1.4.1
@aws-amplify/cli-core: 2.2.1
@aws-amplify/client-config: 1.8.0
@aws-amplify/data-construct: 1.16.3
@aws-amplify/data-schema: 1.21.1
@aws-amplify/deployed-backend-client: 1.8.0
@aws-amplify/form-generator: 1.2.4
@aws-amplify/model-generator: 1.2.0
@aws-amplify/platform-core: 1.10.0
@aws-amplify/plugin-types: 1.11.0
@aws-amplify/sandbox: 2.1.2
@aws-amplify/schema-generator: 1.4.0
@aws-cdk/toolkit-lib: 1.1.1
aws-amplify: 6.15.4
aws-cdk-lib: 2.208.0
typescript: 5.8.3
No AWS environment variables
No CDK environment variables
Describe the bug
I've observed that when my Amplify deployment successfully completes its backend stage but fails during the frontend build, the new backend resources are not rolled back. This leaves my application in an inconsistent state, with a new backend running against an old frontend.
Is this the intended behavior? I expected a failure at any point in the pipeline to trigger a full rollback to the last known good state to ensure consistency.
Observed Behavior:
The new backend is retained, while the old frontend remains active. The overall deployment is marked as failed.
Expected Behavior:
The successfully deployed backend changes are rolled back along with the failed frontend deployment, reverting the entire environment to its previous state.
The logs show a successful backend build followed by a fatal "JavaScript heap out of memory" error during the frontend build.
2025-08-27T15:26:53.707Z [INFO]: # Completed phase: build
2114
## Completed Backend Build
2115
2025-08-27T15:26:53.712Z [INFO]: ## Starting Frontend Build
2116
2025-08-27T15:26:53.712Z [INFO]: # Starting phase: build
2117
# Executing command: npm run build
2118
2025-08-27T15:26:53.833Z [INFO]: > [email protected] build
2119
> tsc && vite build
2120
2025-08-27T15:30:18.862Z [WARNING]: <--- Last few GCs --->
2121
[1410:0x64a48a0] 203381 ms: Scavenge 2033.6 (2076.3) -> 2030.9 (2084.3) MB, 4.8 / 0.0 ms (average mu = 0.599, current mu = 0.341) allocation failure;
2122
[1410:0x64a48a0] 205015 ms: Mark-sweep (reduce) 2049.6 (2095.8) -> 2046.9 (2085.6) MB, 810.6 / 0.0 ms (+ 532.3 ms in 115 steps since start of marking, biggest step 20.2 ms, walltime since start of marking 1459 ms) (average mu = 0.421, current mu = 0.23
2123
<--- JS stacktrace --->
2124
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
2125
2025-08-27T15:30:18.983Z [WARNING]: 1: 0xb9bbf0 node::Abort() [node]
2126
2025-08-27T15:30:18.984Z [WARNING]: 2: 0xaa27ee [node]
2127
2025-08-27T15:30:18.985Z [WARNING]: 3: 0xd734a0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
2128
2025-08-27T15:30:18.985Z [WARNING]: 4: 0xd73847 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
2129
2025-08-27T15:30:18.986Z [WARNING]: 5: 0xf50c55 [node]
2130
2025-08-27T15:30:18.987Z [WARNING]: 6: 0xf6312d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
2131
2025-08-27T15:30:18.987Z [WARNING]: 7: 0xf3d81e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
2132
2025-08-27T15:30:18.988Z [WARNING]: 8: 0xf3ebe7 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
2133
2025-08-27T15:30:18.988Z [WARNING]: 9: 0xf1f160 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
2134
2025-08-27T15:30:18.989Z [WARNING]: 10: 0xf16bd4 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]
2135
2025-08-27T15:30:18.990Z [WARNING]: 11: 0xf18e88 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [node]
2136
2025-08-27T15:30:18.990Z [WARNING]: 12: 0x11f63bd v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [node]
2137
2025-08-27T15:30:18.991Z [WARNING]: 13: 0x11f8fce v8::internal::String::SlowEquals(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::String>) [node]
2138
2025-08-27T15:30:18.992Z [WARNING]: 14: 0x1306795 v8::internal::Runtime_StringEqual(int, unsigned long*, v8::internal::Isolate*) [node]
2139
2025-08-27T15:30:18.992Z [WARNING]: 15: 0x1711cb9 [node]
2140
2025-08-27T15:30:26.113Z [ERROR]: !!! Build failed
2141
2025-08-27T15:30:26.300Z [ERROR]: !!! Error: Command failed with exit code 134
2142
2025-08-27T15:30:26.300Z [INFO]: # Starting environment caching...
2143
2025-08-27T15:30:26.301Z [INFO]: # Uploading environment cache artifact...
2144
2025-08-27T15:30:26.388Z [INFO]: # Uploaded environment cache artifact
2145
2025-08-27T15:30:26.388Z [INFO]: # Environment caching completed
Reproduction steps
Trigger a deployment with both backend and frontend changes.
Ensure the backend deployment succeeds.
Have the frontend build fail (e.g., due to a memory limit).