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

No useful feedback on failure w/ package.json that has conflicts #199

Open
mike-north opened this issue Nov 24, 2018 · 3 comments
Open

No useful feedback on failure w/ package.json that has conflicts #199

mike-north opened this issue Nov 24, 2018 · 3 comments

Comments

@mike-north
Copy link

mike-north commented Nov 24, 2018

NOTE: this issue predates this project's rename to Volta.

Repro Instructions

Create a repo with this package.json

package.json
{
  "name": "ember-cli-document-title-northm",
  "version": "0.0.0-development",
  "description": "Adding document title functionality to your ember app",
  "keywords": [
    "ember-addon"
  ],
  "homepage": "https://github.com/mike-north/ember-cli-document-title-northm",
  "bugs": {
    "url": "https://github.com/mike-north/ember-cli-document-title-northm/issues"
  },
  "license": "MIT",
  "author": "Mike North <michael.l.north@gmail.com> (https://mike.works)",
  "main": "index.js",
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/mike-north/ember-cli-document-title-northm.git"
  },
  "scripts": {
    "build": "ember build",
    "lint:js": "eslint .",
    "start": "ember serve",
    "test": "ember test",
    "travis-deploy-once": "travis-deploy-once",
    "semantic-release": "semantic-release"
  },
  "dependencies": {
    "ember-cli-babel": "^6.6.0"
  },
  "devDependencies": {
    "@commitlint/cli": "7.2.1",
    "@commitlint/config-conventional": "7.1.2",
    "@commitlint/travis-cli": "7.2.1",
<<<<<<< HEAD
    "@mike-north/js-lib-renovate-config": "^1.0.0",
    "@mike-north/js-lib-semantic-release-config": "^1.0.1",
    "@types/ember": "^3.0.25",
    "@types/ember__test-helpers": "^0.7.6",
    "broccoli-asset-rev": "^2.7.0",
    "chai": "^4.1.2",
    "ember-cli": "^3.6.0-beta.1",
    "ember-cli-dependency-checker": "^3.0.0",
    "ember-cli-eslint": "^4.2.1",
    "ember-cli-htmlbars": "^2.0.1",
    "ember-cli-htmlbars-inline-precompile": "^1.0.0",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-qunit": "^4.3.2",
    "ember-cli-shims": "^1.2.0",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-uglify": "^2.0.0",
    "ember-disable-prototype-extensions": "^1.1.2",
    "ember-export-application-global": "^2.0.0",
    "ember-fastboot-addon-tests": "^0.4.0",
    "ember-load-initializers": "^1.1.0",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-resolver": "^4.0.0",
    "ember-source": "~3.3.0",
    "ember-source-channel-url": "^1.0.1",
    "ember-try": "^1.1.0",
    "eslint-plugin-ember": "^5.0.0",
    "eslint-plugin-node": "^6.0.1",
    "husky": "^1.2.0",
    "loader.js": "^4.2.3",
    "qunit-dom": "^0.6.2",
    "travis-deploy-once": "^5.0.9"
=======
    "@mike-north/js-lib-renovate-config": "1.0.0",
    "@mike-north/js-lib-semantic-release-config": "1.0.1",
    "broccoli-asset-rev": "2.7.0",
    "chai": "4.2.0",
    "ember-cli": "3.6.0-beta.1",
    "ember-cli-dependency-checker": "3.0.0",
    "ember-cli-eslint": "4.2.3",
    "ember-cli-htmlbars": "2.0.5",
    "ember-cli-htmlbars-inline-precompile": "1.0.5",
    "ember-cli-inject-live-reload": "1.10.2",
    "ember-cli-qunit": "4.4.0",
    "ember-cli-shims": "1.2.0",
    "ember-cli-sri": "2.1.1",
    "ember-cli-uglify": "2.1.0",
    "ember-disable-prototype-extensions": "1.1.3",
    "ember-export-application-global": "2.0.0",
    "ember-fastboot-addon-tests": "0.5.0",
    "ember-load-initializers": "1.1.0",
    "ember-maybe-import-regenerator": "0.1.6",
    "ember-resolver": "4.5.6",
    "ember-source": "3.5.1",
    "ember-source-channel-url": "1.1.0",
    "ember-try": "1.1.0",
    "eslint-plugin-ember": "5.4.0",
    "eslint-plugin-node": "6.0.1",
    "husky": "1.2.0",
    "loader.js": "4.7.0",
    "qunit-dom": "0.8.1",
    "travis-deploy-once": "5.0.9"
>>>>>>> 1b0732bc6d56cd3e87c32220760a687341129660
  },
  "engines": {
    "node": "6.* || 8.* || >= 10.*"
  },
  "ember-addon": {
    "configPath": "tests/dummy/config"
  },
  "commitlint": {
    "extends": [
      "@commitlint/config-conventional"
    ]
  },
  "husky": {
    "hooks": {
      "commit-msg": "./node_modules/.bin/commitlint -e $HUSKY_GIT_PARAMS"
    }
  },
  "release": {
    "extends": "@mike-north/js-lib-semantic-release-config"
  },
  "toolchain": {
    "node": "8.11.4",
    "yarn": "1.9.2"
  }
}

and then attempt to run yarn

The error

Notion error: an internal error occurred

details: NotionError { error: ErrorImpl { code: KeyMustBeAString, line: 38, column: 1 }, user_friendly: false, exit_code: UnknownError }

stack backtrace:
   0:        0x10fa807ee - backtrace::backtrace::trace::hfab6a7185938ac36
   1:        0x10fa80c9c - backtrace::capture::Backtrace::new_unresolved::ha79782baa461e437
   2:        0x10fa7fcbd - failure::backtrace::internal::InternalBacktrace::new::hbcb9739880567208
   3:        0x10fa7feb4 - _$LT$failure..backtrace..Backtrace$u20$as$u20$core..default..Default$GT$::default::h65a4b2a10e0d004f
   4:        0x10fa7ff2d - failure::backtrace::Backtrace::new::he387e9ad94c85896
   5:        0x10f9c77e3 - _$LT$core..result..Result$LT$T$C$$u20$E$GT$$u20$as$u20$notion_fail..ResultExt$LT$T$C$$u20$E$GT$$GT$::unknown::hdfbc234154842748
   6:        0x10f973ae4 - notion_core::manifest::Manifest::for_dir::he015dccbe7534fea
   7:        0x10f974085 - notion_core::project::Project::for_dir::h5660b22e7bfd788b
   8:        0x10f973f1e - notion_core::project::Project::for_current_dir::h79f6cbc9980498e8
   9:        0x10f9c9a84 - notion_core::session::Session::new::h218b3e8a51ab2886
  10:        0x10f9458ab - notion_core::tool::Tool::launch::ha629c9c74094e603
  11:        0x10f945238 - yarn::main::hacc86d452ac61ed0
  12:        0x10f945205 - std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h1433e35cefe112a7
  13:        0x10fbf7b97 - std::panicking::try::do_call::h90c8830c237e1486 (.llvm.8493183658544739721)
  14:        0x10fc0430e - __rust_maybe_catch_panic
  15:        0x10fbe84fc - std::rt::lang_start_internal::h15876038f4767761
  16:        0x10f94526b - main

As a user, I'd want some information about my package.json being non-json or otherwise malformed -- maybe even providing an indication of where the problem exists in the json file.

@mike-north
Copy link
Author

Related information about detecting merge conflicts: rust-lang/rust#36879

@rwjblue
Copy link
Contributor

rwjblue commented Nov 28, 2018

Just to save additional searching, rust-lang/rust#32059 is another issue related to this.

@chriskrycho
Copy link
Contributor

One possible strategy for solving this: when we detect a parse failure when trying to read package.json, check it for conflict markers with a straightforward regex match on the string contents of the package.json file and report a more specific error type if so; otherwise, return the original error type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants