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

Next now supports next.config.ts as of v15.0.0-canary.60 #28572

Closed
1 of 4 tasks
irontitan76 opened this issue Oct 23, 2024 · 1 comment · Fixed by #28709
Closed
1 of 4 tasks

Next now supports next.config.ts as of v15.0.0-canary.60 #28572

irontitan76 opened this issue Oct 23, 2024 · 1 comment · Fixed by #28709
Assignees
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug

Comments

@irontitan76
Copy link

irontitan76 commented Oct 23, 2024

Current Behavior

Executing an application with a next.config.ts file instead of next.config.{js,mjs,cjs} results in an error: NX Cannot find configuration for task template-app:dev.

Expected Behavior

As of v15.0.0-canary.60, Next.js now supports next.config.ts configuration files. See additional information below for resolution.

GitHub Repo

No response

Steps to Reproduce

  1. Create an nx repo.
  2. Add the @nx/next dependency and setup the plugin.
  3. Add a Next.js application with a next.config.ts file.
  4. Try to run a nx build, nx dev, or the like for the target application.
  5. See error.

Nx Report

Node : 20.9.0
OS : darwin-arm64
Native Target : aarch64-macos
bun : 1.1.22

nx (global) : 19.3.0
nx : 19.7.4
@nx/js : 19.7.4
@nx/jest : 19.7.4
@nx/linter : 19.7.4
@nx/eslint : 19.7.4
@nx/workspace : 19.7.4
@nx/devkit : 19.7.4
@nx/eslint-plugin : 19.7.4
@nx/next : 19.7.4
@nx/react : 19.7.4
@nrwl/tao : 19.7.4
@nx/web : 19.7.4
@nx/webpack : 19.7.4
typescript : 5.7.0-dev.20240925

Registered Plugins:
@nx/next/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

By adjusting this line from:

const nextConfigBlob = '**/next.config.{js,cjs,mjs}';

to

const nextConfigBlob = '**/next.config.{js,cjs,mjs,ts}';

fixes the issue.

irontitan76 added a commit to irontitan76/nx that referenced this issue Oct 23, 2024
@jaysoo jaysoo added the scope: nextjs Issues related to NextJS support for Nx label Oct 25, 2024
jaysoo pushed a commit that referenced this issue Oct 30, 2024
<!-- 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` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

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

Fixes #28572
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: nextjs Issues related to NextJS support for Nx type: bug
Projects
None yet
3 participants