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 18.3.1 rollup config parse error #22866

Closed
wmvm0 opened this issue Apr 17, 2024 · 1 comment
Closed

nx 18.3.1 rollup config parse error #22866

wmvm0 opened this issue Apr 17, 2024 · 1 comment
Assignees
Labels
scope: bundlers Issues related to webpack, rollup type: bug

Comments

@wmvm0
Copy link

wmvm0 commented Apr 17, 2024

Current Behavior

i migrations nx to 18.3.1 , when execute nx build xxx , my rollup config invalid。
image

Expected Behavior

nx build xxx success.

GitHub Repo

No response

Steps to Reproduce

  1. nx 18.3.1
  2. config rollup bundle,
    project.json
"rollupConfig": "packages/common/rollup.config.cjs",
  1. execute nx build xxx

Nx Report

> nx run common:build:production

rootPackagePath  /Users/wmvm/code/me/wmvmjs/package.json
Bundling common...
Unknown output options: 0. Allowed options: amd, assetFileNames, banner, chunkFileNames, compact, dir, dynamicImportFunction, entryFileNames, esModule, exports, extend, externalLiveBindings, file, footer, format, freeze, generatedCode, globals, hoistTransitiveImports, indent, inlineDynamicImports, interop, intro, manualChunks, minifyInternalExports, name, namespaceToStringTag, noConflict, outro, paths, plugins, preferConst, preserveModules, preserveModulesRoot, sanitizeFileName, sourcemap, sourcemapBaseUrl, sourcemapExcludeSources, sourcemapFile, sourcemapPathTransform, strict, systemNullSetters, validate
  index.js 668.06 KB
Error: You must specify "output.file" or "output.dir" for the build.
    at error (/Users/wmvm/code/me/wmvmjs/node_modules/rollup/dist/shared/rollup.js:198:30)
    at /Users/wmvm/code/me/wmvmjs/node_modules/rollup/dist/shared/rollup.js:23836:24
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async catchUnfinishedHookActions (/Users/wmvm/code/me/wmvmjs/node_modules/rollup/dist/shared/rollup.js:23247:20)
    at async rollupExecutor (/Users/wmvm/code/me/wmvmjs/node_modules/@nx/rollup/src/executors/rollup/rollup.impl.js:83:21)
    at async getLastValueFromAsyncIterableIterator (/Users/wmvm/code/me/wmvmjs/node_modules/nx/src/utils/async-iterator.js:13:19)
    at async iteratorToProcessStatusCode (/Users/wmvm/code/me/wmvmjs/node_modules/nx/src/command-line/run/run.js:43:29)
    at async handleErrors (/Users/wmvm/code/me/wmvmjs/node_modules/nx/src/utils/params.js:9:16)
    at async process.<anonymous> (/Users/wmvm/code/me/wmvmjs/node_modules/nx/bin/run-executor.js:59:28)
Bundle failed: common


### Failure Logs

_No response_

### Package Manager Version

_No response_

### Operating System

- [X] 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
@jaysoo
Copy link
Member

jaysoo commented Jun 5, 2024

Hi @wmvm0 This is due to use combining both formats (ESM and CJS) into a single pass in @nx/rollup:rollup. So the output property is now an array.

Here's an example of how to fix this in your project: https://github.com/jaysoo/rollup-nx18.3

@jaysoo jaysoo closed this as completed Jun 5, 2024
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
Development

No branches or pull requests

3 participants