Closed ahmadbakhshi closed 9 months ago
Hi, thanks for reporting this issue.
However, I tried to reproduce your issue and it's working on my end. What I tried:
16.8.0
-> nx build
15.9.6
-> nx build
-> nx migrate latest
-> run migrations
-> nx build
Could you try :
nx reset
to re-build the Nx graph and then nx build
I have added the pnpm-lock.yaml to .gitignore and it seems be the issue. removing it from .gitignore resolved it.
I'm facing exact the same problem. Migrating from 16.7 to 16.8 the build application package.json has no dependecies at all. Also reseted nx.
I'm facing exact the same problem. Migrating from 16.7 to 16.8 the build application package.json has no dependecies at all. Also reseted nx.
Make sure the package lock file is not listed in gitignore. It worked for me
Glad to hear that you found a working solution. @jaqua can you also try what @ahmadbakhshi did in your own repo?
@ndcunningham Unfortunately this is not the issue on my repo. I am still not able to upgrade.
@jaqua i see you have continued the discussion in the issue you linked so to keep the communication in one thread I'll close this.
I'll reopen this issue @jaqua did you ever got around to
Could you try :
- Try running
nx reset
to re-build the Nx graph and thennx build
- Or, provide a small repo of the issue on GitHub
@ndcunningham Hi!, i've tried nx reset
to re-build it. Still doesn't populate the package.json
file at the dist output folder.
{
"name": "next-lebara-eshop",
"version": "0.0.1",
"scripts": {
"start": "next start"
},
"dependencies": {}
}
project.json
{
"name": "next-lebara-eshop",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/dx/next-lebara-eshop",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/next:build",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"outputPath": "dist/apps/dx/next-lebara-eshop"
},
"configurations": {
"development": {
"outputPath": "apps/dx/next-lebara-eshop"
},
"production": {}
}
},
"serve": {
"executor": "@nx/next:server",
"defaultConfiguration": "development",
"options": {
"buildTarget": "next-lebara-eshop:build",
"dev": true
},
"configurations": {
"development": {
"buildTarget": "next-lebara-eshop:build:development",
"dev": true
},
"production": {
"buildTarget": "next-lebara-eshop:build:production",
"dev": false
}
}
},
"export": {
"executor": "@nx/next:export",
"options": {
"buildTarget": "next-lebara-eshop:build:production"
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/dx/next-lebara-eshop/jest.config.ts"
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/dx/next-lebara-eshop/**/*.{ts,tsx,js,jsx}"]
}
},
"pre-commit": {
"executor": "nx:run-commands",
"options": {
"command": "./scripts/sync-version.sh apps/dx/next-lebara-eshop/charts/next-lebara-eshop/Chart.yaml apps/dx/next-lebara-eshop/version.ts"
}
},
"build-package-publish": {
"executor": "nx:run-commands",
"options": {
"command": "./scripts/next-build-package.sh -b dist/apps/dx/next-lebara-eshop -c apps/dx/next-lebara-eshop/charts/next-lebara-eshop -r europe-docker.pkg.dev/mm-prepaid-prod/container-images/next-lebara-eshop -n next-lebara-eshop -H europe-docker.pkg.dev/mm-prepaid-prod/helm-charts"
}
},
"get-artifact-version": {
"executor": "nx:run-commands",
"options": {
"command": "./scripts/get-version.sh apps/dx/next-lebara-eshop/charts/next-lebara-eshop/Chart.yaml"
}
},
"set-artifact-version": {
"executor": "nx:run-commands",
"options": {
"command": "./scripts/set-version.sh apps/dx/next-lebara-eshop/charts/next-lebara-eshop/Chart.yaml"
}
}
},
"tags": ["scope:dx:app:next-lebara-eshop"]
}
next.config.js
//@ts-check
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { withNx } = require('@nx/next')
const { i18n } = require('./next-i18next.config')
/**
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
i18n,
}
module.exports = withNx(nextConfig)
package.json
{
"name": "front",
"version": "1.1.0",
"license": "MIT",
"engines": {
"npm": ">=8.19.2",
"node": ">=18.12.1"
},
"scripts": {
"start": "nx serve",
"build": "nx build",
"test": "nx test",
"lint": "nx lint",
"prepare": "cd ../../../ && husky install pkg/mas-stack/front/.husky",
"pre-commit": "nx affected --target=pre-commit --parallel=1 && lint-staged",
"release": "npx ts-node tools/scripts/new-release"
},
"private": true,
"dependencies": {
"@adyen/adyen-web": "3.20.0",
"@contentful/rich-text-react-renderer": "15.18.0",
"@emotion/react": "11.11.1",
"@emotion/server": "11.11.0",
"@emotion/styled": "11.11.0",
"@fingerprintjs/fingerprintjs": "3.4.1",
"@formatjs/intl-datetimeformat": "6.10.3",
"@formatjs/intl-displaynames": "6.5.2",
"@formatjs/intl-getcanonicallocales": "2.2.1",
"@formatjs/intl-listformat": "7.4.2",
"@formatjs/intl-locale": "3.3.4",
"@formatjs/intl-numberformat": "8.7.2",
"@formatjs/intl-pluralrules": "5.2.6",
"@formatjs/intl-relativetimeformat": "11.2.6",
"@heroicons/react": "2.0.18",
"@lottiefiles/react-lottie-player": "3.5.3",
"@mui/icons-material": "5.14.12",
"@mui/lab": "5.0.0-alpha.147",
"@mui/material": "5.14.12",
"@mui/x-date-pickers": "6.16.0",
"@reduxjs/toolkit": "1.9.7",
"@swc/helpers": "0.5.3",
"@tanstack/query-sync-storage-persister": "4.35.7",
"@tanstack/react-query": "4.35.7",
"@tanstack/react-query-devtools": "4.35.7",
"@tanstack/react-query-persist-client": "4.35.7",
"adyen-latest": "npm:@adyen/adyen-web@5.51.0",
"axios": "1.5.1",
"cleave.js": "1.6.0",
"contentful": "9.3.3",
"core-js": "3.33.0",
"css-mediaquery": "0.1.2",
"date-fns": "2.30.0",
"dompurify": "3.0.6",
"history": "5.3.0",
"i18next": "23.5.1",
"i18next-xhr-backend": "3.2.2",
"iban": "0.0.14",
"idb": "7.1.1",
"jsrsasign": "10.8.6",
"libphonenumber-js": "1.10.46",
"lodash": "4.17.21",
"markdown-to-jsx": "7.3.2",
"md5": "2.3.0",
"mermaid": "10.6.1",
"mobx": "6.10.2",
"mobx-react": "9.0.1",
"next": "13.3.4",
"next-intl": "2.20.2",
"notistack": "3.0.1",
"p-limit": "4.0.0",
"prismjs": "1.29.0",
"qrcode": "1.5.3",
"qs": "6.11.2",
"query-string": "8.1.0",
"react": "18.2.0",
"react-app-polyfill": "3.0.0",
"react-beautiful-dnd": "13.1.1",
"react-dom": "18.2.0",
"react-draggable": "4.4.6",
"react-dropzone": "14.2.3",
"react-hook-form": "7.47.0",
"react-i18next": "13.2.2",
"react-intl": "6.4.7",
"react-json-view": "1.21.3",
"react-markdown": "9.0.1",
"react-papaparse": "4.1.0",
"react-pdf": "6.2.2",
"react-phone-number-input": "3.3.6",
"react-redux": "8.1.3",
"react-responsive-carousel": "3.2.23",
"react-router": "6.16.0",
"react-router-dom": "6.16.0",
"react-simple-code-editor": "0.13.1",
"react-syntax-highlighter": "15.5.0",
"react-use": "17.4.0",
"react-window": "1.8.9",
"recaptcha-v3": "1.10.0",
"recharts": "2.8.0",
"redux-persist": "6.0.0",
"redux-saga": "1.2.3",
"regenerator-runtime": "0.14.0",
"rehype-mermaid": "2.0.1",
"rehype-raw": "7.0.0",
"rxjs": "7.8.1",
"swagger-ui-react": "5.10.0",
"tslib": "2.6.2",
"use-query-params": "2.2.1",
"uuid": "9.0.1",
"yup": "1.3.2"
},
"dependencies-comments": {
"@fingerprintjs/fingerprintjs": "v4 (requires a commercial license to be purchased)!",
"react-pdf": ">6.2.2 not working prooperly in ios (transferring of arraybuffer cannot be properly polyfilled in this engine)"
},
"devDependencies": {
"@babel/core": "7.23.0",
"@babel/preset-react": "7.22.15",
"@babel/preset-typescript": "7.23.0",
"@contentful/rich-text-types": "16.3.0",
"@cucumber/cucumber": "9.6.0",
"@cucumber/html-formatter": "20.4.0",
"@cucumber/messages": "22.0.0",
"@cucumber/pretty-formatter": "1.0.0",
"@hookform/devtools": "4.3.1",
"@nx/cypress": "17.1.3",
"@nx/devkit": "17.1.3",
"@nx/eslint-plugin": "17.1.3",
"@nx/jest": "17.1.3",
"@nx/js": "17.1.3",
"@nx/next": "17.1.3",
"@nx/playwright": "17.1.3",
"@nx/plugin": "17.1.3",
"@nx/react": "17.1.3",
"@nx/storybook": "17.1.3",
"@nx/vite": "17.1.3",
"@nx/web": "17.1.3",
"@nx/webpack": "17.1.3",
"@nx/workspace": "17.1.3",
"@playwright/test": "1.39.0",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
"@storybook/addon-essentials": "7.5.3",
"@storybook/addon-mdx-gfm": "7.5.3",
"@storybook/core-server": "7.5.3",
"@storybook/react": "7.5.3",
"@storybook/react-webpack5": "7.5.3",
"@svgr/webpack": "8.1.0",
"@swc-node/register": "1.6.8",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.99",
"@swc/jest": "0.2.29",
"@testing-library/jest-dom": "6.1.3",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.5.1",
"@types/cleave.js": "1.4.8",
"@types/css-mediaquery": "0.1.2",
"@types/dompurify": "3.0.3",
"@types/fs-extra": "11.0.2",
"@types/iban": "0.0.33",
"@types/inquirer": "9.0.3",
"@types/jest": "29.5.5",
"@types/jsrsasign": "10.5.9",
"@types/md5": "2.3.3",
"@types/node": "20.8.2",
"@types/pixelmatch": "5.2.5",
"@types/pngjs": "6.0.3",
"@types/prismjs": "1.26.1",
"@types/qrcode": "1.5.2",
"@types/react": "18.2.24",
"@types/react-beautiful-dnd": "13.1.5",
"@types/react-dom": "18.2.9",
"@types/react-router-dom": "5.3.3",
"@types/react-test-renderer": "18.0.4",
"@types/react-window": "1.8.6",
"@types/swagger-ui-react": "4.18.3",
"@types/uuid": "9.0.4",
"@typescript-eslint/eslint-plugin": "6.12.0",
"@typescript-eslint/parser": "6.12.0",
"@vitejs/plugin-react": "4.0.4",
"@vitest/coverage-v8": "0.34.6",
"@vitest/ui": "0.34.6",
"babel-jest": "29.7.0",
"babel-loader": "9.1.3",
"contentful-management": "10.46.4",
"contentful-typescript-codegen": "3.4.0",
"css-loader": "6.8.1",
"cucumber-console-formatter": "1.0.0",
"cucumber-html-reporter": "7.1.1",
"cypress": "^13.0.0",
"eslint": "8.50.0",
"eslint-config-next": "13.3.4",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-array-func": "4.0.0",
"eslint-plugin-cypress": "2.15.1",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jest": "27.4.2",
"eslint-plugin-jest-formatting": "3.1.0",
"eslint-plugin-jsx-a11y": "6.7.1",
"eslint-plugin-playwright": "0.15.3",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-sonarjs": "0.21.0",
"eslint-plugin-storybook": "0.6.13",
"eslint-plugin-testing-library": "5.11.0",
"eslint-plugin-unused-imports": "2.0.0",
"fs-extra": "11.1.1",
"husky": "8.0.3",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jsdom": "22.1.0",
"jsonc-eslint-parser": "2.3.0",
"lint-staged": "14.0.1",
"msw": "1.3.2",
"nx": "17.1.3",
"openapi-typescript": "6.7.0",
"pixelmatch": "5.3.0",
"pngjs": "7.0.0",
"prettier": "2.8.8",
"raw-loader": "4.0.2",
"react-refresh": "0.14.0",
"react-test-renderer": "18.2.0",
"storybook": "7.4.6",
"storybook-addon-designs": "7.0.0-beta.2",
"style-loader": "3.3.3",
"stylus": "0.60.0",
"stylus-loader": "7.1.3",
"ts-jest": "29.1.1",
"ts-node": "10.9.1",
"typescript": "5.2.2",
"url-loader": "4.1.1",
"vite": "4.4.11",
"vite-plugin-eslint": "1.8.1",
"vite-tsconfig-paths": "4.2.1",
"vitest": "0.34.6",
"webpack": "5.88.2",
"webpack-merge": "5.9.0",
"@nx/eslint": "17.1.3"
},
"overrides": {
"react-json-view": {
"react": "18.2.0",
"react-dom": "18.2.0"
}
}
}
nx.json
{
"affected": {
"defaultBase": "master"
},
"tasksRunnerOptions": {
"default": {
"options": {
"useLightClient": false
}
}
},
"generators": {
"@nx/react": {
"application": {
"style": "none",
"linter": "eslint",
"bundler": "webpack",
"babel": true
},
"component": {
"style": "none"
},
"library": {
"style": "none",
"linter": "eslint",
"unitTestRunner": "jest"
}
},
"@nx/next": {
"application": {
"style": "none",
"linter": "eslint"
}
},
"@nx/web:application": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "none",
"e2eTestRunner": "none"
}
},
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
},
"test": {
"dependsOn": ["lint"],
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"build": {
"dependsOn": ["^build", "test", "lint"],
"inputs": ["production", "^production"],
"cache": true
},
"build-package-publish": {
"dependsOn": ["lint", "test", "build"],
"cache": true
},
"build-storybook": {
"inputs": [
"default",
"^production",
"{workspaceRoot}/.storybook/**/*",
"{projectRoot}/.storybook/**/*",
"{projectRoot}/tsconfig.storybook.json"
],
"cache": true
},
"e2e": {
"inputs": ["default", "^production"],
"cache": true
},
"@nx/vite:test": {
"dependsOn": ["lint"],
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"@nx/jest:jest": {
"dependsOn": ["lint"],
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true,
"options": {
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": ["{workspaceRoot}/babel.config.json"],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/.storybook/**/*",
"!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)",
"!{projectRoot}/src/test-setup.[jt]s",
"!{projectRoot}/tsconfig.storybook.json"
]
}
}
nx report
> NX Report complete - copy this into the issue template
Node : 20.8.0
OS : darwin-arm64
npm : 10.1.0
nx (global) : 17.1.3
nx : 17.1.3
@nx/js : 17.1.3
@nx/jest : 17.1.3
@nx/linter : 17.1.3
@nx/eslint : 17.1.3
@nx/workspace : 17.1.3
@nx/cypress : 17.1.3
@nx/devkit : 17.1.3
@nx/eslint-plugin : 17.1.3
@nx/next : 17.1.3
@nx/playwright : 17.1.3
@nx/plugin : 17.1.3
@nx/react : 17.1.3
@nx/storybook : 17.1.3
@nrwl/tao : 17.1.3
@nx/vite : 17.1.3
@nx/web : 17.1.3
@nx/webpack : 17.1.3
typescript : 5.2.2
Hey, can you do the following: Try with the latest version of Nx currently 17.2.6
For those having issues with the dependencies section in the package.json file generated during build, in our case the problem is that the NX monorepo was inside a repository with a .gitignore containing package-lock.json, which prevents the dependencies from being populated.
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
nextjs package.json is not populated with any dependency.
project.json:
dist/apps/.../package.json:
Expected Behavior
With version 16.16.0, I have this:
package.json:
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response