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

Error "Unknown Protocol on url "[object Object]"." #3

Closed
vateseeb opened this issue Jun 13, 2018 · 15 comments
Closed

Error "Unknown Protocol on url "[object Object]"." #3

vateseeb opened this issue Jun 13, 2018 · 15 comments

Comments

@vateseeb
Copy link

When I run

ng g ngx-spec:spec _catalog-explorer/content/zooming/zooming.component

I get an error saying "Unknown Protocol on url "[object Object]"."

The path is correct and the component exists.

@smnbbrv
Copy link
Owner

smnbbrv commented Jun 13, 2018

Hi,

for me it runs perfectly:

$ ng g ngx-spec:spec _catalog-explorer/content/zooming/zooming.component
CREATE src/app/_catalog-explorer/content/zooming/zooming.component.spec.ts (635 bytes)

It actually does not matter whether the component exists or not :D

@vateseeb
Copy link
Author

which @angular/cli version are you using?
I am using 6.0.8

@smnbbrv
Copy link
Owner

smnbbrv commented Jun 13, 2018

  "devDependencies": {
    "@angular-devkit/build-angular": "^0.6.8",
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "^6.0.4",
    "@angular/language-service": "^6.0.4",
    "@types/jasmine": "^2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "bread-compressor-cli": "^1.0.0",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.4.3",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ngx-spec": "^0.1.2",
    "protractor": "^5.3.2",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~2.7.2"
  }

@smnbbrv
Copy link
Owner

smnbbrv commented Jun 26, 2018

@assafshemesh could you please post your package.json dependencies?

@assafshemesh
Copy link

"dependencies": {
    "@angular-devkit/core": "0.6.8",
    "@angular-devkit/schematics": "0.6.8",
    "@angular/animations": "5.1.0",
    "@angular/cdk": "5.2.1",
    "@angular/common": "5.1.0",
    "@angular/compiler": "5.1.0",
    "@angular/core": "5.1.0",
    "@angular/forms": "5.1.0",
    "@angular/http": "5.1.0",
    "@angular/material": "5.2.1",
    "@angular/platform-browser": "5.1.0",
    "@angular/platform-browser-dynamic": "5.1.0",
    "@angular/platform-server": "5.1.0",
    "@angular/router": "5.1.0",
    "angular-tree-component": "7.2.0",
    "angular2-highcharts": "^0.5.5",
    "bootstrap": "^3.3.7",
    "chart.js": "^2.7.0",
    "core-js": "^2.4.1",
    "ie-shim": "^0.1.0",
    "locks": "^0.2.2",
    "ng2-charts": "^1.6.0",
    "ngx-clipboard": "11.1.1",
    "ngx-perfect-scrollbar": "5.3.1",
    "patternomaly": "^1.3.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.5.6",
    "uuid": "3.2.1",
    "xlsx": "^0.13.0",
    "zone.js": "0.8.19"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.6.8",
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "^6.0.4",
    "@angular/language-service": "^6.0.4",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "angular2-router-loader": "^0.3.4",
    "angular2-template-loader": "^0.6.0",
    "awesome-typescript-loader": "^3.0.4",
    "codelyzer": "~4.0.1",
    "css-loader": "^0.25.0",
    "file-loader": "^0.11.2",
    "innosetup-compiler": "^5.5.9",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-junit-reporter": "^1.2.0",
    "ngx-spec": "^0.1.2",
    "protractor": "^5.3.0",
    "raw-loader": "^0.5.1",
    "to-string-loader": "^1.1.4",
    "ts-node": "~3.2.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3",
    "webpack": "^4.12.1",
    "webpack-dev-server": "^3.1.4",
    "webpack-merge": "^4.1.3"
  }

@smnbbrv
Copy link
Owner

smnbbrv commented Jun 27, 2018

Those dependencies should be mentioned in dev dependencies and not in normal dependencies

    "@angular-devkit/core": "0.6.8",
    "@angular-devkit/schematics": "0.6.8",

Could you

  1. remove them from the dependencies
  2. remove node_modules and package-lock.json
  3. run npm i

and check again?

@smnbbrv
Copy link
Owner

smnbbrv commented Jun 27, 2018

@assafshemesh correction: those dependencies should not appear even at dev dependencies. Check my devDependencies from message above

@assafshemesh
Copy link

I removed those 2 dependencies (and indeed they were not required to run the project).
The problem remains: Unknown Protocol on url "[object Object]"

@viktormelnychuk
Copy link

viktormelnychuk commented Jul 4, 2018

@smnbbrv Hi, I have same issue with generating spec files. Here is my dependencies of package.json:

"dependencies": {
    "@angular/animations": "^6.0.3",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "@ng-bootstrap/ng-bootstrap": "^2.2.0",
    "core-js": "^2.5.4",
    "rxjs": "^6.0.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.6.8",
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "^6.0.4",
    "@angular/language-service": "^6.0.4",
    "@types/jasmine": "^2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "bread-compressor-cli": "^1.0.0",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.4.3",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "ngx-spec": "^0.1.2",
    "protractor": "^5.3.2",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~2.7.2"
  }

Edit: Looks like it does not work on Widows. Tried same from linux subsystem and it worked well

@smnbbrv
Copy link
Owner

smnbbrv commented Jul 4, 2018

Aha that’s a really good hint thanks!

@smnbbrv
Copy link
Owner

smnbbrv commented Jul 5, 2018

@viktormelnychuk @vateseeb @assafshemesh

Could you please check whether the issue is resolved with 0.1.3?

@viktormelnychuk
Copy link

@smnbbrv Just rechecked. Works on windows. However it assumes I am in the src/app directory.
For example:

H:\Projects\angular-test>ng g ngx-spec:spec src\app\components\comp\comp.component
CREATE src/app/src/app/components/comp/comp.component.spec.ts (782 bytes)

notice path from where command was run and extra /src/app in the output. File is actually created in src/app/src/app/components/comp/comp.component.spec.ts.

Is I run this command from the src/app folder it creates spec file along regular component/service file

H:\Projects\angular-test\src\app>ng g ngx-spec:spec components\comp\comp.component
CREATE src/app/components/comp/comp.component.spec.ts (726 bytes)

@smnbbrv
Copy link
Owner

smnbbrv commented Jul 6, 2018

that's a different story and it corresponds to the design of the angular cli itself. It assumes you are in the src/app folder. Please create another issue and I will close this one then.

@smnbbrv smnbbrv closed this as completed Jul 6, 2018
@viktormelnychuk
Copy link

@smnbbrv I do not think that is an issue. But I guess we can just update the Readme to include this info :)

@smnbbrv
Copy link
Owner

smnbbrv commented Jul 6, 2018

True, did that.

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

No branches or pull requests

4 participants