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

nx rollup build fails in CI without any useful error message #26986

Closed
jayshah123 opened this issue Jul 18, 2024 · 2 comments
Closed

nx rollup build fails in CI without any useful error message #26986

jayshah123 opened this issue Jul 18, 2024 · 2 comments
Assignees

Comments

@jayshah123
Copy link

Current Behavior

I see an error without any useful information:

  Bundling featureX...
  
      at error (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:198:30)
      at throwPluginError (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:21718:12)
      at Object.error (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:22672:20)
      at RollupContext.error (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:1457:26)
      at /home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27639:26
      at Array.forEach (<anonymous>)
      at printDiagnostics (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27615:17)
      at typecheckFile (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27972:9)
      at Object.<anonymous> (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:28118:21)
      at Generator.next (<anonymous>)
      at /home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:63:69
      at new Promise (<anonymous>)
      at __awaiter (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:59:10)
      at Object.transform (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:28099:20)
      at /home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:22879:40
  Bundle failed: featureX

Expected Behavior

Bundle should build or report a useful error

GitHub Repo

No response

Steps to Reproduce

  1. Trying to build via npx nx affected:build --base=master --verbose --skip-nx-cache in CI

Project.json file used is following:

{
  "name": "featureX",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "packages/featureX/src",
  "projectType": "library",
  "tags": [],
  "targets": {
    "lint": {
      "executor": "@nrwl/linter:eslint",
      "outputs": ["{options.outputFile}"],
      "options": {
        "lintFilePatterns": ["packages/featureX/**/*.{ts,tsx,js,jsx}"]
      }
    },
    "build": {
      "executor": "@nrwl/rollup:rollup",
      "outputs": ["{options.outputPath}"],
      "options": {
        "skipTypeField": true,
        "format": ["esm", "cjs"],
        "outputPath": "dist/packages/featureX",
        "tsConfig": "packages/featureX/tsconfig.lib.json",
        "project": "packages/featureX/package.json",
        "entryFile": "packages/featureX/src/index.ts",
        "external": ["react/jsx-runtime"],
        "rollupConfig": "@nrwl/react/plugins/bundle-rollup",
        "compiler": "babel",
        "assets": [
          {
            "glob": "packages/featureX/README.md",
            "input": ".",
            "output": "."
          }
        ]
      }
    },
    "test": {
      "executor": "@nrwl/jest:jest",
      "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
      "options": {
        "jestConfig": "packages/featureX/jest.config.ts",
        "passWithNoTests": true
      },
      "configurations": {
        "ci": {
          "ci": true,
          "codeCoverage": true
        }
      }
    }
  }
}

Nx Report

NX   Report complete - copy this into the issue template

Node   : 18.18.0
OS     : darwin-arm64
npm    : 9.8.1

nx                 : 18.3.5
@nx/js             : 18.3.5
@nx/jest           : 18.3.5
@nx/linter         : 18.3.5
@nx/eslint         : 18.3.5
@nx/workspace      : 18.3.5
@nx/devkit         : 18.3.5
@nx/eslint-plugin  : 18.3.5
@nx/react          : 18.3.5
@nx/rollup         : 18.3.5
@nrwl/tao          : 18.3.5
@nx/web            : 18.3.5
typescript         : 5.4.5

Failure Logs

I see an error without any useful information:

  Bundling featureX...
  
      at error (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:198:30)
      at throwPluginError (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:21718:12)
      at Object.error (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:22672:20)
      at RollupContext.error (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:1457:26)
      at /home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27639:26
      at Array.forEach (<anonymous>)
      at printDiagnostics (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27615:17)
      at typecheckFile (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27972:9)
      at Object.<anonymous> (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:28118:21)
      at Generator.next (<anonymous>)
      at /home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:63:69
      at new Promise (<anonymous>)
      at __awaiter (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:59:10)
      at Object.transform (/home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:28099:20)
      at /home/runner/work/mycompany-fe-shared/mycompany-fe-shared/node_modules/rollup/dist/shared/rollup.js:22879:40
  Bundle failed: featureX


### Package Manager Version

9.8.1

### Operating System

- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)

### Additional Information

_No response_
@jayshah123 jayshah123 changed the title nx rollup build fails in CI without any error nx rollup build fails in CI without any useful error message Jul 18, 2024
@FrozenPandaz FrozenPandaz added the scope: bundlers Issues related to webpack, rollup label Jul 18, 2024
@Coly010
Copy link
Contributor

Coly010 commented Jul 26, 2024

This is going to be pretty difficult to debug and investigate without a reproduction.

Could you please provide a repo with a minimal reproduction of the problem?

Copy link

github-actions bot commented Aug 3, 2024

This issue has been automatically marked as stale because no reproduction was provided within 7 days.
Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue.
Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues.
This issue will be closed in 21 days if a reproduction is not provided.
If a reproduction has been provided, please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions github-actions bot added the stale label Aug 3, 2024
@Coly010 Coly010 closed this as completed Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants