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 use devkit to run watch mode with AsyncIterableIterator job but failed #23028

Closed
4 tasks
xujiandream opened this issue Apr 26, 2024 · 0 comments · Fixed by #23229
Closed
4 tasks
Assignees
Labels
scope: bundlers Issues related to webpack, rollup type: bug

Comments

@xujiandream
Copy link

xujiandream commented Apr 26, 2024

Current Behavior

Nx version 18.3.4

Screenshot2024_04_26_174822
When we use rollup watch mode, the nx task will failed.

"serve": {
      "executor": "@nx/rollup:rollup",
      "outputs": ["{options.outputPath}"],
      "options": {
        "watch": true,
        "outputPath": "dist/client-controller",
        "tsConfig": "client/controller/tsconfig.lib.json",
        "project": "client/controller/package.json",
        "main": "client/controller/src/index.ts",
        "rollupConfig": ["client/controller/rollup.config.dev.js"]
      }
    },
image This is what the `getLastValueFromAsyncIterableIterator` returns.

The iteratorToProcessStatusCode func judge the callback return by getLastValueFromAsyncIterableIterator, however this function return a object like { [Symbol.asyncIterator] () { // the async task create by watch mode } }, the object result has no success property and the rollup task never runs before the process exit.

Expected Behavior

rollup watch mode should works fine

GitHub Repo

No response

Steps to Reproduce

  1. move the rollup to watch mode
  2. run the task

Nx Report

N/A

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@AgentEnder AgentEnder added the scope: bundlers Issues related to webpack, rollup label Apr 29, 2024
FrozenPandaz pushed a commit that referenced this issue May 8, 2024
…yncIterables returned from executors (#23229)

When an executor returns an `AsyncIterable` Nx fails because it cannot
read the value using `getLastValueFromAsyncIterableIterator` (which only
supports `AsyncIterableIterator`. This PR updates it to support both so
executors like `@nx/rollup:rollup` will work.


<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
Running Nx command fails if executor returns `AsyncIterable` e.g. by
calling `createAsyncIterable`.

## Expected Behavior
Nx command succeeds when executor returns `AsyncIterable`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #23028
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
3 participants