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 build failed #186

Closed
Kamsou opened this issue Jun 27, 2024 · 10 comments
Closed

CloudFlare build failed #186

Kamsou opened this issue Jun 27, 2024 · 10 comments
Labels
question Further information is requested

Comments

@Kamsou
Copy link

Kamsou commented Jun 27, 2024

Describe the bug
I initiated a Nuxt Hub project. I haven't added any features. I just pushed it on my Github. I created my CloudFlare account. I linked the projects. But when deploying on CloudFlare I get errors that I don't understand.

Steps to reproduce

Settings on CloudFlare

Build command:
npm run build
Build output directory:
/dist

Errors Logs on CloudFlare

2024-06-27T08:12:24.084874Z	Cloning repository...
2024-06-27T08:12:24.71599Z	From https://github.com/Kamsou/my-todo-of-the-day
2024-06-27T08:12:24.716455Z	 * branch            9317a6362c8b3d435294c8c1f02f15cfc954530f -> FETCH_HEAD
2024-06-27T08:12:24.716551Z	
2024-06-27T08:12:24.750032Z	HEAD is now at 9317a63 yarn
2024-06-27T08:12:24.750447Z	
2024-06-27T08:12:24.833832Z	
2024-06-27T08:12:24.834318Z	Using v2 root directory strategy
2024-06-27T08:12:24.859785Z	Success: Finished cloning repository files
2024-06-27T08:12:26.512626Z	Checking for configuration in a wrangler.toml configuration file (BETA)
2024-06-27T08:12:26.513264Z	
2024-06-27T08:12:26.61417Z	No wrangler.toml file found. Continuing.
2024-06-27T08:12:26.762926Z	Detected the following tools from environment: [email protected], [email protected]
2024-06-27T08:12:26.763687Z	Installing project dependencies: yarn
2024-06-27T08:12:27.359276Z	➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 👍
2024-06-27T08:12:27.359867Z	
2024-06-27T08:12:27.467892Z	➤ YN0000: ┌ Resolution step
2024-06-27T08:12:28.78427Z	➤ YN0032: │ fsevents@npm:2.3.3: Implicit dependencies on node-gyp are discouraged
2024-06-27T08:12:30.483326Z	➤ YN0032: │ @parcel/watcher@npm:2.4.1: Implicit dependencies on node-gyp are discouraged
2024-06-27T08:12:30.97336Z	➤ YN0061: │ glob@npm:7.2.3 is deprecated: Glob versions prior to v9 are no longer supported
2024-06-27T08:12:30.973592Z	➤ YN0061: │ glob@npm:8.1.0 is deprecated: Glob versions prior to v9 are no longer supported
2024-06-27T08:12:31.322675Z	➤ YN0032: │ node-addon-api@npm:7.1.0: Implicit dependencies on node-gyp are discouraged
2024-06-27T08:12:31.410945Z	➤ YN0061: │ npmlog@npm:5.0.1 is deprecated: This package is no longer supported.
2024-06-27T08:12:31.437143Z	➤ YN0061: │ inflight@npm:1.0.6 is deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
2024-06-27T08:12:31.506638Z	➤ YN0061: │ rimraf@npm:3.0.2 is deprecated: Rimraf versions prior to v4 are no longer supported
2024-06-27T08:12:31.625433Z	➤ YN0061: │ are-we-there-yet@npm:2.0.0 is deprecated: This package is no longer supported.
2024-06-27T08:12:31.664818Z	➤ YN0061: │ gauge@npm:3.0.2 is deprecated: This package is no longer supported.
2024-06-27T08:12:34.828365Z	➤ YN0061: │ rollup-plugin-inject@npm:3.0.2 is deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
2024-06-27T08:12:34.876042Z	➤ YN0061: │ sourcemap-codec@npm:1.4.8 is deprecated: Please use @jridgewell/sourcemap-codec instead
2024-06-27T08:12:38.664451Z	➤ YN0002: │ @netlify/serverless-functions-api@npm:1.18.4 doesn't provide @opentelemetry/api (p2a898), requested by @opentelemetry/core
2024-06-27T08:12:38.664733Z	➤ YN0002: │ @netlify/serverless-functions-api@npm:1.18.4 doesn't provide @opentelemetry/api (p418a4), requested by @opentelemetry/resources
2024-06-27T08:12:38.664865Z	➤ YN0002: │ @netlify/serverless-functions-api@npm:1.18.4 doesn't provide @opentelemetry/api (p5dc1c), requested by @opentelemetry/otlp-transformer
2024-06-27T08:12:38.664975Z	➤ YN0002: │ @netlify/serverless-functions-api@npm:1.18.4 doesn't provide @opentelemetry/api (p0acee), requested by @opentelemetry/sdk-trace-node
2024-06-27T08:12:38.665117Z	➤ YN0002: │ @netlify/serverless-functions-api@npm:1.18.4 doesn't provide @opentelemetry/api (p7ca4a), requested by @opentelemetry/sdk-node
2024-06-27T08:12:38.665226Z	➤ YN0002: │ @nuxt/eslint@npm:0.3.13 [a4e71] doesn't provide vite (p90c66), requested by @nuxt/devtools-kit
2024-06-27T08:12:38.665353Z	➤ YN0002: │ @nuxthub/core@npm:0.6.17 doesn't provide vite (p64c56), requested by @nuxt/devtools-kit
2024-06-27T08:12:38.665461Z	➤ YN0002: │ @vue/devtools-core@npm:7.3.3 doesn't provide vite (p5fb74), requested by vite-hot-client
2024-06-27T08:12:38.665561Z	➤ YN0002: │ nuxt@npm:3.12.2 [a4e71] doesn't provide vite (p6835a), requested by @nuxt/devtools
2024-06-27T08:12:38.665692Z	➤ YN0060: │ nuxthub-starter@workspace:. provides eslint (pcded5) with version 9.5.0, which doesn't satisfy what @nuxt/eslint-config and some of its descendants request
2024-06-27T08:12:38.665864Z	➤ YN0002: │ nuxthub-starter@workspace:. doesn't provide typescript (pb359c), requested by vue-tsc
2024-06-27T08:12:38.665968Z	➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
2024-06-27T08:12:38.672605Z	➤ YN0000: └ Completed in 11s 205ms
2024-06-27T08:12:38.724502Z	➤ YN0000: ┌ Post-resolution validation
2024-06-27T08:12:38.724744Z	➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
2024-06-27T08:12:38.72482Z	➤ YN0000: └ Completed
2024-06-27T08:12:38.72488Z	➤ YN0000: Failed with errors in 11s 262ms
2024-06-27T08:12:38.831015Z	Error: Exit with error code: 1
2024-06-27T08:12:38.831398Z	    at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
2024-06-27T08:12:38.831502Z	    at Object.onceWrapper (node:events:652:26)
2024-06-27T08:12:38.831688Z	    at ChildProcess.emit (node:events:537:28)
2024-06-27T08:12:38.831772Z	    at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2024-06-27T08:12:38.839843Z	Failed: build command exited with code: 1
2024-06-27T08:12:39.664675Z	Failed: error occurred while running build command

Expected behavior
Deploy done !

Copy link
Contributor

atinux commented Jun 27, 2024

Hello @Kamsou

Could you try to install the dependencies with pnpm and commit the pnpm-lock.json file and see if the deploy works?

@atinux atinux added the question Further information is requested label Jun 27, 2024 — with Volta.net
@Kamsou
Copy link
Author

Kamsou commented Jun 27, 2024

Thanks @atinux , the deployment works now!

But when i visit my app, i have an 500 Error. Its a problem with wrangler ?

▲ [WARNING] Non-relative path "#internal/nitro/routes/openapi" is not allowed when "baseUrl" is not set (did you forget a leading "./"?) [tsconfig.json]

    .nuxt/tsconfig.json:87:8:
      87 │         "#internal/nitro/routes/openapi"
         ╵         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[wrangler:inf] Ready on http://localhost:8788
▲ [WARNING] Non-relative path "#internal/nitro/routes/openapi" is not allowed when "baseUrl" is not set (did you forget a leading "./"?) [tsconfig.json]

    .nuxt/tsconfig.json:87:8:
      87 │         "#internal/nitro/routes/openapi"
         ╵         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


⎔ Starting local server...
✨ Parsed 0 valid redirect rules.
✨ Parsed 3 valid header rules.
[wrangler:inf] GET / 500 Internal Server Error 

Copy link
Contributor

atinux commented Jun 28, 2024

What command did you run?

@Kamsou
Copy link
Author

Kamsou commented Jun 28, 2024

What command did you run?

first pnpm run build
then, pnpm run preview
then, npx wrangler pages dev dist/

Copy link
Contributor

atinux commented Jun 28, 2024

We have an issue to preview locally at the moment, but the deployment should work with no issue actually.

@Kamsou
Copy link
Author

Kamsou commented Jun 28, 2024

The deployment works, but when i check website, i have an error 500 : https://b7bb5547.my-todo-of-the-day.pages.dev/

(if you want to see my deployment logs :
my-todo-of-the-day.b7bb5547-08a2-4e68-aed3-eeebd1333d8e.log )

@atinux
Copy link
Contributor

atinux commented Jun 28, 2024

Sorry about this @Kamsou

I just tried now and I can see the 500 error in development as it is currently related to the fact that we don't generate the wrangler.toml at the moment (see #113 for ongoing progress).

I tried to deploy in production and seems to work with no issue.

CleanShot 2024-06-28 at 13 46 34@2x
CleanShot 2024-06-28 at 13 46 39@2x

Did you deploy using the NuxtHub Admin or the NuxtHub CLI?

@Kamsou
Copy link
Author

Kamsou commented Jun 28, 2024

No problem.
For deploy, I went to Cloudflare (by Nuxhub Admin link) and imported my github project. And it launched the deployment from there. I didn't do anything else.

For info:

  • I tried to import my Cloudflare project but it says : @nuxhub/core not found
Capture d’écran 2024-06-28 à 14 14 50
  • If I try Import github project, i have "In Use" :
Capture d’écran 2024-06-28 à 14 16 49

Copy link
Contributor

atinux commented Jun 28, 2024

For deploy, I went to Cloudflare (by Nuxhub Admin link) and imported my github project. And it launched the deployment from there. I didn't do anything else.

The main issue of this is you need to go through NuxtHub Admin for the deployment to make sure that we spawn all the necessary resources (R2, KV, D1).

Could you please remove the project on Cloudflare UI?

Then import the GitHub repository from the NuxtHub admin please? 🙏

@Kamsou
Copy link
Author

Kamsou commented Jun 28, 2024

That was it, its works now ! I didn't do the installation in the right order 🥹 (sorry about that)
Thanks @atinux 🤝

@Kamsou Kamsou closed this as completed Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants