Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare Pages from GitHub Angualr is wrong. #14584

Closed
sakairy opened this issue May 15, 2024 · 1 comment
Closed

Cloudflare Pages from GitHub Angualr is wrong. #14584

sakairy opened this issue May 15, 2024 · 1 comment
Assignees
Labels
content:edit Request for content edits documentation Documentation edits product:pages

Comments

@sakairy
Copy link

sakairy commented May 15, 2024

Existing documentation URL(s)

https://developers.cloudflare.com/pages/framework-guides/deploy-an-angular-site/

What changes are you suggesting?

I don't know how document should be updated to.
On Cloudflare Pages, you can deploy Angular project from github. It doesn't have ssr. I used the same configulation to the document (it same to default when you selected Angular in Pages). However, deploy failed. Deploy should be succeed if you follow document.

Additional information

This is log:

2024-05-15T12:57:38.253121Z Cloning repository...
2024-05-15T12:57:39.133622Z From https://github.com/sakairy/angular-dafault
2024-05-15T12:57:39.134214Z * branch c11475b24bde875a417f0e51249c56c84941b5ca -> FETCH_HEAD
2024-05-15T12:57:39.134391Z
2024-05-15T12:57:39.166537Z HEAD is now at c11475b a
2024-05-15T12:57:39.166996Z
2024-05-15T12:57:39.25089Z
2024-05-15T12:57:39.251362Z Using v2 root directory strategy
2024-05-15T12:57:39.277307Z Success: Finished cloning repository files
2024-05-15T12:57:40.929308Z Checking for configuration in a wrangler.toml configuration file (BETA)
2024-05-15T12:57:40.930077Z
2024-05-15T12:57:41.03351Z No wrangler.toml file found. Continuing.
2024-05-15T12:57:42.191765Z Detected the following tools from environment: nodejs@22.1.0, npm@9.6.7
2024-05-15T12:57:42.192325Z Installing nodejs 22.1.0
2024-05-15T12:57:42.739671Z Trying to update node-build... ok
2024-05-15T12:57:42.948321Z Downloading node-v22.1.0-linux-x64.tar.gz...
2024-05-15T12:57:42.9486Z -> https://nodejs.org/dist/v22.1.0/node-v22.1.0-linux-x64.tar.gz
2024-05-15T12:57:45.05836Z Installing node-v22.1.0-linux-x64...
2024-05-15T12:57:45.442632Z Installed node-v22.1.0-linux-x64 to /opt/buildhome/.asdf/installs/nodejs/22.1.0
2024-05-15T12:57:45.442912Z
2024-05-15T12:57:46.521985Z Installing project dependencies: npm clean-install --progress=false
2024-05-15T12:57:54.60785Z
2024-05-15T12:57:54.60807Z added 925 packages, and audited 926 packages in 8s
2024-05-15T12:57:54.608221Z
2024-05-15T12:57:54.608386Z 118 packages are looking for funding
2024-05-15T12:57:54.60845Z run npm fund for details
2024-05-15T12:57:54.609752Z
2024-05-15T12:57:54.609886Z found 0 vulnerabilities
2024-05-15T12:57:54.626615Z Executing user command: npm run build
2024-05-15T12:57:55.029422Z
2024-05-15T12:57:55.029632Z > nossr@0.0.0 build
2024-05-15T12:57:55.029874Z > ng build
2024-05-15T12:57:55.029958Z
2024-05-15T12:57:55.739985Z - Building...
2024-05-15T12:57:55.740557Z
2024-05-15T12:58:00.346291Z Initial chunk files | Names | Raw size | Estimated transfer size
2024-05-15T12:58:00.346663Z main-EQBYMZJE.js | main | 193.18 kB | 52.50 kB
2024-05-15T12:58:00.346877Z polyfills-S3BTP7ME.js | polyfills | 33.24 kB | 10.76 kB
2024-05-15T12:58:00.347097Z styles-5INURTSO.css | styles | 0 bytes | 0 bytes
2024-05-15T12:58:00.347226Z
2024-05-15T12:58:00.347344Z | Initial total | 226.42 kB | 63.26 kB
2024-05-15T12:58:00.347511Z
2024-05-15T12:58:00.3476Z Output location: /opt/buildhome/repo/dist/nossr
2024-05-15T12:58:00.347741Z
2024-05-15T12:58:00.347929Z Application bundle generation complete. [4.605 seconds]
2024-05-15T12:58:00.347995Z
2024-05-15T12:58:00.452683Z Finished
2024-05-15T12:58:00.453334Z Note: No functions dir at /functions found. Skipping.
2024-05-15T12:58:00.453484Z Validating asset output directory
2024-05-15T12:58:00.453652Z Error: Output directory "dist/cloudflare" not found.
2024-05-15T12:58:01.388842Z Failed: build output directory not found

My project is in line 2 in log. It is simple and just includes files generated when you do ng new and .nvmrc.
If you want to reproduce, you execute ng new and add .nvmrc.

And defauld build directory is strange.
https://community.cloudflare.com/t/fail-to-deploy-angular-project-on-cloudflare-pages/655126

@kodster28
Copy link
Contributor

Howdy @sakairy, the guide is referring to projects created from scratch using npm create cloudflare@latest my-angular-app -- --framework=angular, not necessarily project that have already existed before.

If you're using an existing project, you may need to update the build directory to match what's specified in your angular.json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content:edit Request for content edits documentation Documentation edits product:pages
Projects
None yet
Development

No branches or pull requests

6 participants