withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
45.84k stars 2.41k forks source link

Astro DB Github action failing #11285

Closed thomasledoux1 closed 3 months ago

thomasledoux1 commented 3 months ago

Astro Info

Astro                    v4.10.3
Node                     v20.13.0
System                   macOS (arm64)
Package Manager          npm
Output                   hybrid
Adapter                  @astrojs/vercel/serverless
Integrations             @astrojs/tailwind
                         @astrojs/react
                         astro-expressive-code
                         @astrojs/mdx
                         astro:db
                         @astrojs/db/file-url
                         @astrojs/sitemap

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Since upgrading my dependencies (and starting to use Astro Actions, not sure if related), I'm getting the following error in the "Run withastro/action-studio@main" part of the Astro DB Github action.

Run withastro/action-studio@main
  with:
    github-token: ***
  env:
    ASTRO_STUDIO_APP_TOKEN: ***
Event: push
Pushing database schema...
/home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/rollup/dist/native.js:59
        throw new Error(
              ^

Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/48[2](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:2)8). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/rollup/dist/native.js:68:76)
    ... [3](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:3) lines matching cause stack trace ...
    at Module._load (node:internal/modules/cjs/loader:102[4](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:4):12)
    at cjsLoader (node:internal/modules/esm/translators:348:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:297:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:222:2[5](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:5))
    at async ModuleLoader.import (node:internal/modules/esm/loader:31[6](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:7):24) {
  [cause]: Error: Cannot find module '@rollup/rollup-linux-x64-gnu'
  Require stack:
  - /home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/rollup/dist/native.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
      at Module._load (node:internal/modules/cjs/loader:986:2[7](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:8))
      at Module.require (node:internal/modules/cjs/loader:1233:19)
      at require (node:internal/modules/helpers:179:1[8](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:9))
      at requireWithFriendlyError (/home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/rollup/dist/native.js:41:[10](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:11))
      at Object.<anonymous> (/home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/rollup/dist/native.js:68:76)
      at Module._compile (node:internal/modules/cjs/loader:1358:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
      at Module.load (node:internal/modules/cjs/loader:[12](https://github.com/thomasledoux1/website-thomas-astro/actions/runs/9581552366/job/26418608659#step:6:13)08:32)
      at Module._load (node:internal/modules/cjs/loader:1024:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/rollup/dist/native.js'
    ]
  }
}

Node.js v20.14.0
Error: Command failed with exit code 1: /home/runner/work/website-thomas-astro/website-thomas-astro/node_modules/astro/astro.js db push

What's the expected result?

For it now to fail, like it was working before upgrading the dependencies to the latest versions. Runs can be found here: https://github.com/thomasledoux1/website-thomas-astro/actions Commit after which it started failing: https://github.com/thomasledoux1/website-thomas-astro/commit/4402cabee1e1fa8b343f8c716c6a257be8acdcba

I already tried removing the package-lock.json and recreating it by running 'npm i', that didn't help.

Link to Minimal Reproducible Example

https://github.com/thomasledoux1/website-thomas-astro

Participation

thomasledoux1 commented 3 months ago

I get the same error when deploying to Vercel:

Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
    at requireWithFriendlyError (/vercel/path0/node_modules/rollup/dist/native.js:59:9)
    at Object.<anonymous> (/vercel/path0/node_modules/rollup/dist/native.js:68:76)
    ... 3 lines matching cause stack trace ...
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at cjsLoader (node:internal/modules/esm/translators:366:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:315:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24) {
  [cause]: Error: Cannot find module '@rollup/rollup-linux-x64-gnu'
  Require stack:
  - /vercel/path0/node_modules/rollup/dist/native.js
      at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
      at Module._load (node:internal/modules/cjs/loader:984:27)
      at Module.require (node:internal/modules/cjs/loader:1231:19)
      at require (node:internal/modules/helpers:179:18)
      at requireWithFriendlyError (/vercel/path0/node_modules/rollup/dist/native.js:41:10)
      at Object.<anonymous> (/vercel/path0/node_modules/rollup/dist/native.js:68:76)
      at Module._compile (node:internal/modules/cjs/loader:1369:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
      at Module.load (node:internal/modules/cjs/loader:1206:32)
      at Module._load (node:internal/modules/cjs/loader:1022:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ '/vercel/path0/node_modules/rollup/dist/native.js' ]
  }
thomasledoux1 commented 3 months ago

Caused by package-lock.json not updating correctly, had to remove node_modules & package-lock.json and then re-run npm install

iozcelik commented 4 weeks ago

Caused by package-lock.json not updating correctly, had to remove node_modules & package-lock.json and then re-run npm install

I have same error. I do that however nothing fixed.