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

Renovate fails on comments in package.json #3479

Closed
mrtnzlml opened this Issue Apr 3, 2019 · 4 comments

Comments

Projects
None yet
3 participants
@mrtnzlml
Copy link

mrtnzlml commented Apr 3, 2019

What Renovate type are you using?
Renovate CLI

Describe the bug
Renovate fails on comments in package.json.

Did you see anything helpful in debug logs?
Not very helpful error:

INFO: Branch needs creating (repository=incubator/universe, dependencies=react,react-test-renderer, branch=renovate/react-packages)
ERROR: Error updating branch: libVersion.startsWith is not a function (repository=incubator/universe, dependencies=react,react-test-renderer, branch=renovate/react-packages)
       "err": {
         "message": "libVersion.startsWith is not a function",
         "stack": "TypeError: libVersion.startsWith is not a function\n    at listLocalLibs (/usr/src/app/lib/manager/npm/post-update/index.js:269:22)\n    at Object.writeExistingFiles (/usr/src/app/lib/manager/npm/post-update/index.js:149:20)"
       }

To Reproduce
Steps to reproduce the behavior:

  1. Create a repository for JS project with comments in your package.json
  2. 💥

Expected behavior
It should ignore the comments just like NPM or Yarn does.

@rarkins

This comment has been minimized.

Copy link
Collaborator

rarkins commented Apr 3, 2019

Can you provide an example package.json?

@mrtnzlml

This comment has been minimized.

Copy link
Author

mrtnzlml commented Apr 3, 2019

Here is our root `package.json` for our Yarn Workspaces
{
  "private": true,
  "workspaces": {
    "packages": [
      "src/apps/*",
      "src/packages/*"
    ],
    "nohoist": [
      "**/react-native",
      "**/react-native/**",
      "**/react-native-scripts",
      "**/react-native-scripts/**",
      "**/expo",
      "**/expo/**"
    ]
  },
  "engines": {
    "yarn": ">=1.0.0"
  },
  "dependencies": {},
  "devDependencies": {
    "//": [
      "Please note: `react` dependency here is necessary in order to solve hoisting issues",
      "with React Native (Expo) and their locked React version. Yarn hoisted wrong version.",
      "It can eventually be removed (try Relay and RN-Expo examples to verify it works)."
    ],
    "@babel/core": "^7.4.3",
    "@babel/node": "^7.2.2",
    "@kiwicom/babel-preset-kiwicom": "^2.0.0",
    "@kiwicom/eslint-config": "^3",
    "@kiwicom/js": "^0",
    "@kiwicom/monorepo": "^0",
    "@kiwicom/monorepo-npm-publisher": "^1",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^24.7.0",
    "babel-loader": "^8.0.5",
    "chalk": "^2.4.2",
    "eslint": "^5.16.0",
    "flow-bin": "^0.96.0",
    "glob": "^7.1.3",
    "jest": "^24.7.0",
    "jest-junit": "^6.2.1",
    "react": "^16.8.6",
    "semver": "^6.0.0",
    "supertest": "^4.0.1"
  },
  "jest": {
    "testRegex": "/scripts/jest/dontRunJestDirectly\\.js$"
  },
  "scripts": {
    "//": [
      "Please do not add new scripts here. Use scripts section in your workspace instead."
    ],
    "lint": "eslint --print-config . | eslint-config-prettier-check && yarn jest --config=.jest-eslint.config.js",
    "test": "yarn babel-node src/packages/monorepo/bin/monorepo-run-tests.js",
    "test-ci": "yarn run flow && yarn run lint && yarn run test --ci --colors"
  }
}

There is a small chance that the comments are not the actual issue (dunno how to try it quickly). But our guy from platform team was pretty confident about it.

@rarkins

This comment has been minimized.

Copy link
Collaborator

rarkins commented Apr 3, 2019

Yeah, I think it's because we're calling .startsWith() on an array

@rarkins rarkins closed this in c55481f Apr 3, 2019

@renovate-bot

This comment has been minimized.

Copy link
Collaborator

renovate-bot commented Apr 3, 2019

🎉 This issue has been resolved in version 15.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.