nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
910 stars 50 forks source link

CloudFlare build failed by importing GitHub repository #240

Closed mtzrmzia closed 2 weeks ago

mtzrmzia commented 3 weeks ago

Describe the bug When importing a repository from GitHub trough NuxtHub Admin and deploying it, it simply gives an error.

Steps to reproduce

  1. Select a repository with @nuxthub/core installed. You can clone it and try to deploy trough NuxtHub Admin repo
  2. Select Region, branch, leave the project root directory empty Screenshot 2024-08-23@2x
  3. Click Import repository, got the following errors:
17:55:44.594 Cloning repository...
17:55:45.427 From https://github.com/mtzrmzia/esteban-app
17:55:45.428  * branch            f756b5cd8f391718c3da26f60f2aa02b3a01766d -> FETCH_HEAD
17:55:45.428 
17:55:45.455 HEAD is now at f756b5c Feat: Install @nuxthub/core
17:55:45.455 
17:55:45.538 
17:55:45.539 Using v2 root directory strategy
17:55:45.563 Success: Finished cloning repository files
17:55:47.169 Checking for configuration in a wrangler.toml configuration file (BETA)
17:55:47.170 
17:55:47.276 No wrangler.toml file found. Continuing.
17:55:47.419 Detected the following tools from environment: yarn@3.6.3, nodejs@18.17.1
17:55:47.420 Installing project dependencies: yarn
17:55:48.010 ➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 👍
17:55:48.010 
17:55:48.103 ➤ YN0000: ┌ Resolution step
17:55:49.080 ➤ YN0032: │ fsevents@npm:2.3.3: Implicit dependencies on node-gyp are discouraged
17:55:49.445 ➤ YN0032: │ @parcel/watcher@npm:2.4.1: Implicit dependencies on node-gyp are discouraged
17:55:50.037 ➤ YN0032: │ node-addon-api@npm:7.1.1: Implicit dependencies on node-gyp are discouraged
17:55:50.671 ➤ YN0061: │ glob@npm:7.2.3 is deprecated: Glob versions prior to v9 are no longer supported
17:55:50.672 ➤ YN0061: │ glob@npm:8.1.0 is deprecated: Glob versions prior to v9 are no longer supported
17:55:51.076 ➤ 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.
17:55:51.207 ➤ YN0061: │ npmlog@npm:5.0.1 is deprecated: This package is no longer supported.
17:55:51.283 ➤ YN0061: │ rimraf@npm:3.0.2 is deprecated: Rimraf versions prior to v4 are no longer supported
17:55:51.333 ➤ YN0061: │ are-we-there-yet@npm:2.0.0 is deprecated: This package is no longer supported.
17:55:51.372 ➤ YN0061: │ gauge@npm:3.0.2 is deprecated: This package is no longer supported.
17:55:52.893 ➤ 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.
17:55:52.986 ➤ YN0061: │ sourcemap-codec@npm:1.4.8 is deprecated: Please use @jridgewell/sourcemap-codec instead
17:55:53.981 ➤ YN0002: │ @nuxthub/core@npm:0.7.3 doesn't provide vite (pfda69), requested by @nuxt/devtools-kit
17:55:53.981 ➤ YN0002: │ @vue/devtools-core@npm:7.3.3 doesn't provide vite (p5fb74), requested by vite-hot-client
17:55:53.981 ➤ YN0002: │ nuxt@npm:3.13.0 [1f046] doesn't provide vite (p3c226), requested by @nuxt/devtools
17:55:53.981 ➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
17:55:53.990 ➤ YN0000: └ Completed in 5s 887ms
17:55:54.052 ➤ YN0000: ┌ Post-resolution validation
17:55:54.053 ➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
17:55:54.053 ➤ YN0000: └ Completed
17:55:54.053 ➤ YN0000: Failed with errors in 5s 954ms
17:55:54.113 Error: Exit with error code: 1
17:55:54.113     at ChildProcess.<anonymous> (/snapshot/dist/run-build.js)
17:55:54.113     at Object.onceWrapper (node:events:652:26)
17:55:54.114     at ChildProcess.emit (node:events:537:28)
17:55:54.114     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
17:55:54.122 Failed: build command exited with code: 1
17:55:54.949 Failed: error occurred while running build command

Expected behavior Deploy done!

I did not do any configuration through Cloudflare

Screenshot 2024-08-23@2x

NOTE: I tried another new repository but using pnpm instead yarn, and following the same steps, works! So, maybe the issue is related using another package manager but pnpm?

NOTE2: It seems that adding the packageManager in package.json fixed the issue. So is it mandatory to specify the packageManager being used?

{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "dependencies": {
    "@nuxthub/core": "^0.7.3",
    "nuxt": "^3.13.0",
    "vue": "latest"
  },
  "devDependencies": {
    "wrangler": "^3.72.2"
  },
  "packageManager": "yarn@1.22.22"
}
atinux commented 2 weeks ago

Thanks for looking at it. I seems that packageManager is becoming mandatory in the latest Node version.

Will update our templates to reflect that.

atinux commented 2 weeks ago

Should be good now!