-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Creating a new NextJs Application with App Router option enabled fails to build #22065
Comments
Hi, can you provide a sample repo of this? Your initial comment said you generated |
Hello! https://github.com/fsrajner/nextjs_sample_error/tree/main/org This is the create workspace script: Need to install the following packages: (⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ idealTree:d2207cf76adb22dc: sill idealTree buildDeps NX Let's create a new workspace [https://nx.dev/getting-started/intro] ✔ Where would you like to create your workspace? · org ✔ Which stack do you want to use? · react NX Creating your v18.0.7 workspace. ✔ Installing dependencies with npm NX Directory is already under version control. Skipping initialization of git. ——————————————————————————————————————————————————————————————————————————————— NX First time using Nx? Check out this interactive Nx tutorial. |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
I got the same error, I just generated a new application with the command When I try to run the project, I get the same error as mentioned above. UPDATE: for my use case I solved the problem by removing the I hope this helps. |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
The problem here is using the CSS-in-JS lib This is some support that they added but the results may vary based on your environment and use-case. |
For me removing everything |
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. |
Current Behavior
Creating a new NextJS Applictaion using
nx g @nx/next:app my-new-app
with the following options:✔ Which E2E test runner would you like to use? · cypress
✔ Would you like to use the App Router (recommended)? (Y/n) · true
✔ Would you like to use
src/
directory? (Y/n) · truegenerates a project which fails to build, error message:
`
▲ Next.js 14.0.4
✓ Creating an optimized production build
✓ Compiled successfully
Skipping linting
Checking validity of types .
We detected TypeScript in your project and reconfigured your tsconfig.json file for you. Strict-mode is set to false by default.
The following suggested values were added to your tsconfig.json. These values can be changed to fit your project's needs:
✓ Checking validity of types
Collecting page data .TypeError: n.createContext is not a function
at 1410 (/Users/infom/Workspace/falvapp/org/apps/web2/.next/server/chunks/823.js:1:81000)
at t (/Users/infom/Workspace/falvapp/org/apps/web2/.next/server/webpack-runtime.js:1:127)
at 908 (/Users/infom/Workspace/falvapp/org/apps/web2/.next/server/chunks/823.js:1:82414)
at t (/Users/infom/Workspace/falvapp/org/apps/web2/.next/server/webpack-runtime.js:1:127)
at 8205 (/Users/infom/Workspace/falvapp/org/apps/web2/.next/server/app/page.js:1:2178)
at Function.t (/Users/infom/Workspace/falvapp/org/apps/web2/.next/server/webpack-runtime.js:1:127)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async collectGenerateParams (/Users/infom/Workspace/falvapp/org/node_modules/next/dist/build/utils.js:884:17)
at async /Users/infom/Workspace/falvapp/org/node_modules/next/dist/build/utils.js:1100:17
at async Span.traceAsyncFn (/Users/infom/Workspace/falvapp/org/node_modules/next/dist/trace/trace.js:147:20)
Generating with the same options, except not enabling App Router will generate an Application that compiles successfully.
Expected Behavior
Generating a new NextJS project can be built.
GitHub Repo
No response
Steps to Reproduce
nx g @nx/next:app my-new-app
npx nx run my-new-app:build
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: