-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Patches not being applied during Jenkins builds #97
Comments
Also fails in Netlify. |
Thanks for the report! 🙏 I haven't been able to reproduce this issue on netlify (I tested various versions of patch-package and they all worked). and I don't have a jenkins setup to test on. If you could provide the error messages it might help me to fix these issues. |
Forgot to update here, but I used the description here to set it up: Perhaps the npmjs page should be updated? |
Below is the output from the Jenkins build. As you can see the patch-package never ran. Yet running The issue I was trying to solve was that create-react-app 2 does not allow for absolute imports, so I wanted to alter the react-scripts package, so that I could do something like
And here's my package.json {
"name": "apps",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^3.3.0",
"@material-ui/icons": "^3.0.1",
"@sentry/browser": "^4.2.1",
"classnames": "^2.2.6",
"create-react-app": "^2.1.0",
"lodash": "^4.17.11",
"md5": "^2.2.1",
"moize": "^5.4.1",
"notistack": "^0.3.7",
"pure-react-carousel": "^1.16.2",
"react-ga": "^2.5.3",
"react-intl": "^2.7.2",
"react-router-dom": "^4.3.1",
"react-scripts": "^2.1.1",
"recompose": "^0.30.0",
"store": "^2.0.12",
"svg-react-loader": "^0.4.6",
"uuid": "^3.3.2"
},
"scripts": {
"ci:test": "NODE_PATH=./ CI=true react-scripts test",
"start": "BROWSER=none NODE_PATH=./ react-scripts start",
"build": "NODE_PATH=./ react-scripts build",
"test": "NODE_PATH=./ react-scripts test",
"eject": "NODE_PATH=./ react-scripts eject",
"lint": "NODE_PATH=./ tslint src/**/*.{ts,tsx}",
"format": "NODE_PATH=./ prettier src/**/*.{ts,tsx} --write",
"type": "NODE_PATH=./ tsc --noEmit",
"manage:translations": "node ./scripts/extractForTranslation.js",
"postinstall": "patch-package"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
],
"devDependencies": {
"@babel/core": "^7.1.2",
"@types/classnames": "^2.2.6",
"@types/enzyme": "^3.1.14",
"@types/enzyme-adapter-react-16": "^1.0.3",
"@types/lodash": "^4.14.117",
"@types/md5": "^2.1.33",
"@types/react-intl": "^2.3.11",
"@types/react-router-dom": "^4.3.1",
"@types/recompose": "^0.27.0",
"@types/store": "^2.0.0",
"@types/uuid": "^3.4.4",
"babel-loader": "^8.0.4",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"husky": "^1.1.2",
"lint-staged": "^7.3.0",
"patch-package": "^5.1.1",
"postinstall-postinstall": "^2.0.0",
"prettier": "^1.14.3",
"react-intl-translations-manager": "^5.0.3",
"react-test-renderer": "^16.6.0",
"rimraf": "^2.6.2",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"tslint-react": "^3.6.0",
"typescript-react-intl": "^0.3.0"
},
"lint-staged": {
"*.{ts,tsx}": [
"yarn format",
"yarn lint --fix",
"git add"
]
},
"husky": {
"hooks": {
"pre-commit": "yarn ci:test && yarn type && lint-staged"
}
}
} |
@martinmckenna Thanks for the details! So running @sergonius Yeah I'm going to update that. Thanks for pointing it out! |
@ds300 Exactly. The
Is the exact thing I was patching |
Has anyone figured out how to get this working with Zeit now? I've tried both There are a few discussions here: Edit: I am also using yarn. |
Updating to patch-package@beta should fix the problem if it's git related,
since we no longer use git. You might need to recreate your patch files.
I'm working on backwards compatibility or at least an upgrade path.
…On Thu, 17 Jan 2019, 18:59 Patrick Cooney, ***@***.***> wrote:
Has anyone figured out how to get this working with Zeit now? I've tried
both postinstall-postinstall and postinstall-prepare but neither seems to
be working. The build just hangs :/
There are a few discussions here:
vercel/vercel#1666 <vercel/vercel#1666>
vercel/vercel#1661 <vercel/vercel#1661>
zeit/now-builders#49 <https://github.com/zeit/now-builders/issues/49>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABL1qWcLIktfDTlZ_sz-YcDwZVZ7_ywfks5vEMf0gaJpZM4Y5sb1>
.
|
Awesome, thank you for the quick respo |
That doesn't look like patch-package's output. I realise it mentions
patching things but I'm 100% sure those messages are coming from somewhere
else 😕 looks like it's happening before the postinstall hook too. Does the
error message change if you disable patch-package?
…On Thu, 17 Jan 2019, 23:19 Patrick Cooney, ***@***.***> wrote:
Still no dice unfortunately, getting the same error which looks like this:
[image: image]
<https://user-images.githubusercontent.com/11021913/51353865-d9472d00-1a7f-11e9-8ed1-20bef95f0feb.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABL1qcQb62R20sCHih6pw0Dlj3sdwhY1ks5vEQUQgaJpZM4Y5sb1>
.
|
v6.0.0 was just released! So I'm going to close this. As mentioned patch-package now doesn't use git when applying patches so it should work wherever node works. |
So as an update - I figured out my issue wasn't with Jenkins, but instead I wasn't copying over the /patches dir into my Docker container. So when I ran |
BTW, if anyone runs across this same problem deploying to Netlify, one thing to check is whether you're actually running the same dependency files locally vs. Netlify (or CI or...). In my case, I was patching React and was running the development version locally and the minified version of react in Netlify. But my original patch only patched React's development bundle file. Once I patched the prod bundle too, everything worked great. |
To help debug what is going wrong with patch-package, when using Yarn v2, add the This causes yarn to output the log messages from all the build scripts, letting you see any errors that patch-package may be hitting. (in my case, the problem was that I had a symlinked package which caused a [sub]dependency of both my app and lib to resolve to a different version than on my host computer, causing patch-package to be unable to match the patch-file to the files in the within-docker |
I have installed patch-package to use in my react-app and running locally, everything works fine. With an update to date patch file, running
yarn && yarn run build
correctly applies the patches.However, when Jenkins tries to run
yarn && yarn run build
, the patches do not get applied correctly. I have tried installing both patch-packaage and postinstall-postinstall as both a regular dependency and a dev dependency.Is there any other obvious steps I might be missing here? Has anyone tried using this package with a deployment process, such as Circle CI or Jenkins?
The text was updated successfully, but these errors were encountered: