Skip to content

Wrangler fails during Angular setup with Cannot set properties of undefined (setting 'experimentalPlatform') #12950

@vimalan-bonito

Description

@vimalan-bonito

What versions & operating system are you using?

Wrangler build on Cloudflare pages

Please provide a link to a minimal reproduction

https://github.com/vimalan-bonito/cloudflare-angular

Describe the Bug

Deploying a fresh Angular 21 app (created via ng new) via the Cloudflare pages fails with:

✘ [ERROR] Cannot set properties of undefined (setting 'experimentalPlatform')

Please provide any relevant error logs

2026-03-18T08:09:36.333Z Initializing build environment...
2026-03-18T08:09:37.953Z Success: Finished initializing build environment
2026-03-18T08:09:38.555Z Cloning repository...
2026-03-18T08:09:39.637Z Restoring from dependencies cache
2026-03-18T08:09:39.640Z Restoring from build output cache
2026-03-18T08:09:39.648Z Detected the following tools from environment: npm@11.6.2, nodejs@22.16.0
2026-03-18T08:09:39.760Z Installing project dependencies: npm clean-install --progress=false
2026-03-18T08:09:47.978Z
2026-03-18T08:09:47.979Z added 493 packages, and audited 494 packages in 8s
2026-03-18T08:09:47.979Z
2026-03-18T08:09:47.979Z 114 packages are looking for funding
2026-03-18T08:09:47.979Z run npm fund for details
2026-03-18T08:09:47.985Z
2026-03-18T08:09:47.985Z 2 high severity vulnerabilities
2026-03-18T08:09:47.986Z
2026-03-18T08:09:47.986Z To address all issues (including breaking changes), run:
2026-03-18T08:09:47.986Z npm audit fix --force
2026-03-18T08:09:47.986Z
2026-03-18T08:09:47.986Z Run npm audit for details.
2026-03-18T08:09:48.173Z Executing user build command: npm run build
2026-03-18T08:09:48.393Z
2026-03-18T08:09:48.394Z > cf-angular@0.0.0 build
2026-03-18T08:09:48.394Z > ng build
2026-03-18T08:09:48.394Z
2026-03-18T08:09:49.065Z ❯ Building...
2026-03-18T08:09:54.779Z ✔ Building...
2026-03-18T08:09:54.780Z Initial chunk files | Names | Raw size | Estimated transfer size
2026-03-18T08:09:54.781Z main-6PM5B36I.js | main | 213.15 kB | 58.25 kB
2026-03-18T08:09:54.781Z styles-44VXQ2BN.css | styles | 4.58 kB | 1.43 kB
2026-03-18T08:09:54.781Z
2026-03-18T08:09:54.781Z | Initial total | 217.73 kB | 59.68 kB
2026-03-18T08:09:54.781Z
2026-03-18T08:09:54.781Z Application bundle generation complete. [5.713 seconds] - 2026-03-18T08:09:54.778Z
2026-03-18T08:09:54.783Z
2026-03-18T08:09:54.795Z Output location: /opt/buildhome/repo/dist/cloudflare-angular
2026-03-18T08:09:54.796Z
2026-03-18T08:09:54.899Z Success: Build command completed
2026-03-18T08:09:55.034Z Executing user deploy command: npx wrangler deploy
2026-03-18T08:09:56.805Z npm warn exec The following package was not found and will be installed: wrangler@4.75.0
2026-03-18T08:10:04.590Z
2026-03-18T08:10:04.590Z ⛅️ wrangler 4.75.0
2026-03-18T08:10:04.590Z ───────────────────
2026-03-18T08:10:04.731Z
2026-03-18T08:10:04.732Z Detected Project Settings:
2026-03-18T08:10:04.732Z - Worker Name: cloudflare-angular
2026-03-18T08:10:04.732Z - Framework: Angular
2026-03-18T08:10:04.732Z - Build Command: npm run build
2026-03-18T08:10:04.732Z - Output Directory: dist/
2026-03-18T08:10:04.732Z
2026-03-18T08:10:04.733Z ? Do you want to modify these settings?
2026-03-18T08:10:04.734Z 🤖 Using fallback value in non-interactive context: no
2026-03-18T08:10:04.735Z
2026-03-18T08:10:04.735Z 📦 Install packages:
2026-03-18T08:10:04.735Z - wrangler (devDependency)
2026-03-18T08:10:04.736Z
2026-03-18T08:10:04.736Z 📝 Update package.json scripts:
2026-03-18T08:10:04.736Z - "deploy": "npm run build && wrangler deploy"
2026-03-18T08:10:04.736Z - "preview": "npm run build && wrangler dev"
2026-03-18T08:10:04.736Z - "cf-typegen": "wrangler types"
2026-03-18T08:10:04.736Z
2026-03-18T08:10:04.737Z 📄 Create wrangler.jsonc:
2026-03-18T08:10:04.737Z {
2026-03-18T08:10:04.737Z "$schema": "node_modules/wrangler/config-schema.json",
2026-03-18T08:10:04.737Z "name": "cloudflare-angular",
2026-03-18T08:10:04.737Z "compatibility_date": "2025-09-27",
2026-03-18T08:10:04.737Z "observability": {
2026-03-18T08:10:04.737Z "enabled": true
2026-03-18T08:10:04.737Z },
2026-03-18T08:10:04.737Z "main": "./dist/server/server.mjs",
2026-03-18T08:10:04.737Z "assets": {
2026-03-18T08:10:04.739Z "binding": "ASSETS",
2026-03-18T08:10:04.739Z "directory": "dist/browser"
2026-03-18T08:10:04.739Z },
2026-03-18T08:10:04.739Z "compatibility_flags": [
2026-03-18T08:10:04.739Z "nodejs_compat"
2026-03-18T08:10:04.739Z ]
2026-03-18T08:10:04.739Z }
2026-03-18T08:10:04.739Z
2026-03-18T08:10:04.739Z 🛠️ Configuring project for Angular
2026-03-18T08:10:04.740Z
2026-03-18T08:10:04.740Z ? Proceed with setup?
2026-03-18T08:10:04.740Z 🤖 Using fallback value in non-interactive context: yes
2026-03-18T08:10:08.823Z ├ Updating angular.json config
2026-03-18T08:10:08.828Z
2026-03-18T08:10:08.829Z Cloudflare collects anonymous telemetry about your usage of Wrangler. Learn more at https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md
2026-03-18T08:10:08.830Z
2026-03-18T08:10:08.882Z ✘ [ERROR] Cannot set properties of undefined (setting 'experimentalPlatform')
2026-03-18T08:10:08.882Z
2026-03-18T08:10:08.882Z
2026-03-18T08:10:08.898Z If you think this is a bug then please create an issue at https://github.com/cloudflare/workers-sdk/issues/new/choose
2026-03-18T08:10:08.899Z ? Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue.
2026-03-18T08:10:08.899Z 🤖 Using fallback value in non-interactive context: no
2026-03-18T08:10:08.923Z 🪵 Logs were written to "/opt/buildhome/.config/.wrangler/logs/wrangler-2026-03-18_08-10-03_839.log"
2026-03-18T08:10:08.983Z Failed: error occurred while running deploy command

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions