nrwl / nx

Smart Monorepos · Fast CI

Home Page:https://nx.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nx rollup build fails in CI without any useful error message

jayshah123 opened this issue · comments

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_