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

Type error: Module '"./.nx-helpers/compiled.js"' has no exported member 'composePlugins'. #23048

Closed
1 of 4 tasks
Bulletninja opened this issue Apr 27, 2024 · 2 comments
Closed
1 of 4 tasks

Comments

@Bulletninja
Copy link

Current Behavior

Always fails, in any of my projects, even though it's setup from the default next generators

Expected Behavior

Should not complain about composePlugins not being exported.

GitHub Repo

No response

Steps to Reproduce

  1. Generate the default next app
  2. Fail to build
  3. Change "strict": false in tsconfig.json
  4. Build successfully
  5. Change back "strict": true in tsconfig.json
  6. Fail to build because of complain with composePlugins

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : darwin-arm64
npm    : 10.5.0

nx                 : 18.3.3
@nx/js             : 18.3.3
@nx/jest           : 18.3.3
@nx/linter         : 18.3.3
@nx/eslint         : 18.3.3
@nx/workspace      : 18.3.3
@nx/cypress        : 18.3.3
@nx/devkit         : 18.3.3
@nx/eslint-plugin  : 18.3.3
@nx/next           : 18.3.3
@nx/node           : 18.3.3
@nx/playwright     : 18.3.3
@nx/react          : 18.3.3
@nrwl/tao          : 18.3.3
@nx/web            : 18.3.3
@nx/webpack        : 18.3.3
typescript         : 5.4.5
---------------------------------------
Community plugins:
@nx/rspack : 18.0.6

Failure Logs

[NX CLOUD] Verifying current cloud bundle
[NX CLOUD] A local bundle currently exists:  {
  version: '2404.23.6.hotfix5',
  fullPath: '/MYPROJECTPATHHERE/.nx/cache/cloud/2404.23.6.hotfix5'
}
[NX CLOUD] Last verification was within the past 30 minutes, will not verify this time
[NX CLOUD] Done:  /MYPROJECTPATHHERE/.nx/cache/cloud/2404.23.6.hotfix5
[Nx Cloud] Unable to detect a VCS context from the environment.

 NX   RunStart


{
  "meta": {},
  "branch": null,
  "runGroup": "b4a25a8344246918ba1d860d9c515a5acc328d2c",
  "ciExecutionId": null,
  "ciExecutionEnv": "",
  "hashes": [
    "13229980026899555889"
  ],
  "machineInfo": {
    "machineId": "<machineId>",
    "platform": "darwin",
    "version": "Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:43 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6000",
    "cpuCores": 8
  },
  "vcsContext": null
}

RunStart duration: 200

 NX   Nx Cloud: Cache miss 13229980026899555889.


> nx run orders-clients-v2:build:production --skip-cache

  �[1m�[38;2;173;127;168m▲ Next.js 14.2.3�[39m�[22m
 �[37m�[1m �[22m�[39m Creating an optimized production build ...
 �[32m�[1m✓�[22m�[39m Compiled successfully
 �[37m�[1m �[22m�[39m Skipping linting
 �[37m�[1m �[22m�[39m Checking validity of types ...

Failed to compile.

./dist/next.config.js:4:9
Type error: Module '"./.nx-helpers/compiled.js"' has no exported member 'composePlugins'.
  2 |
  3 | // eslint-disable-next-line @typescript-eslint/no-var-requires
> 4 | const { composePlugins, withNx } = require('./.nx-helpers/compiled.js');
    |         ^
  5 |
  6 | /**
  7 |  * @type {import('./.nx-helpers/compiled.js').WithNxOptions}
Build process exited due to code 1  

 NX   Running target build for project orders-clients-v2 failed

Failed tasks:

- orders-clients-v2:build:production

Hint: run the command with --verbose for more details.

View structured, searchable error logs at https://nx.app/runs/<runId>

Package Manager Version

npm version 10.5.0

Operating System

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

Additional Information

The only thing I could do in some places was implementing my own composer function and completely eliminate that default import.

@Bulletninja
Copy link
Author

Ran a bunch of stuff and seems it works, but I don't know what fixed it:

  • npx nx reset
  • npx nx clear-cache
  • rf ./node_modules/.cache/nx
  • rf .//.nx
  • rf .//dist (this is where I usually move my builds (dists) to, just use your path which might be the default one)

@AgentEnder
Copy link
Member

Hey @Bulletninja 👋 I'm going to close this out as you mentioned its now working. Most likely the node modules or dist had somehow became out of sync.

If the issue recurs feel free to tag me to reopen this issue or create a new one referencing this one.

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

2 participants