deno
deno copied to clipboard
`deno task build` fails when trying to build default angular 20 project
Version: Deno 2.5.6 (installed using winget)
Steps:
- Create a zoneless, vanilla angular 20 project with SSR, SSG, prefetch. (Used Angular 20.3.10)
- Try to build the project using
denoby runningdeno task build
It shows the following error:
Task build ng build
Browser bundles
Initial chunk files | Names | Raw size | Estimated transfer size
main-CWHAWT7Z.js | main | 248.01 kB | 68.70 kB
styles-5INURTSO.css | styles | 0 bytes | 0 bytes
| Initial total | 248.01 kB | 68.70 kB
Server bundles
Initial chunk files | Names | Raw size
server.mjs | server | 1.30 MB |
main.server.mjs | main.server | 694.46 kB |
polyfills.server.mjs | polyfills.server | 233.48 kB |
chunk-L2MVFUKD.mjs | - | 1.32 kB |
chunk-T55IDOPT.mjs | - | 976 bytes |
Lazy chunk files | Names | Raw size
chunk-HKQTHSU5.mjs | xhr2 | 12.15 kB |
chunk-QN7HHIJH.mjs | xhr2 | 12.08 kB |
Prerendered 0 static routes.
Application bundle generation failed. [4.829 seconds] - 2025-11-17T21:52:23.037Z
✘ [ERROR] An error occurred while extracting routes.
[ERR_UNSUPPORTED_ESM_URL_SCHEME] Only file and data URLs are supported by the default ESM loader. Received protocol 'memory'
When building normally using npm it succeeds:
> [email protected] build
> ng build
Browser bundles
Initial chunk files | Names | Raw size | Estimated transfer size
main-CWHAWT7Z.js | main | 248.01 kB | 68.72 kB
styles-5INURTSO.css | styles | 0 bytes | 0 bytes
| Initial total | 248.01 kB | 68.72 kB
Server bundles
Initial chunk files | Names | Raw size
server.mjs | server | 1.30 MB |
main.server.mjs | main.server | 694.46 kB |
polyfills.server.mjs | polyfills.server | 233.48 kB |
chunk-L2MVFUKD.mjs | - | 1.32 kB |
chunk-T55IDOPT.mjs | - | 976 bytes |
Lazy chunk files | Names | Raw size
chunk-HKQTHSU5.mjs | xhr2 | 12.15 kB |
chunk-QN7HHIJH.mjs | xhr2 | 12.08 kB |
Prerendered 1 static route.
Application bundle generation complete. [4.799 seconds] - 2025-11-17T21:53:56.946Z
More context:
Node.js's module.register() (from node:module) allows custom loader hooks. Angular uses this to handle memory:// URLs for in-memory server bundles.
Deno's module.register() is not implemented yet.
Then it should not be mentioned that Deno 2 supports Angular.
Reference: https://deno.com/blog/v2.0