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: only absolute urls are supported #105

Closed
NeoCN opened this issue Oct 25, 2017 · 4 comments
Closed

Error: only absolute urls are supported #105

NeoCN opened this issue Oct 25, 2017 · 4 comments

Comments

@NeoCN
Copy link

NeoCN commented Oct 25, 2017

Description

Just want to do some customize, but got Error: only absolute urls are supported when run npm test

Steps to reproduce the issue:

  1. clone the repo, and change proxy field in package.json file to http://localhost:8080
  2. run npm test

Describe the results you received:

 RUNS  src/middlewares/index.test.js
/Users/xxx/git/jaeger-ui/node_modules/react-scripts/scripts/test.js:20
  throw err;
  ^

Error: only absolute urls are supported
    at /Users/xxx/git/jaeger-ui/node_modules/node-fetch/index.js:54:10
    at new Promise (<anonymous>)
    at new Fetch (/Users/xxx/git/jaeger-ui/node_modules/node-fetch/index.js:49:9)
    at Fetch (/Users/xxx/git/jaeger-ui/node_modules/node-fetch/index.js:37:10)
    at Object.<anonymous>.module.exports (/Users/xxx/git/jaeger-ui/node_modules/isomorphic-fetch/fetch-npm-node.js:8:19)
    at getJSON (/Users/xxx/git/jaeger-ui/src/api/jaeger.js:32:68)
    at Object.fetchServiceOperations (/Users/xxx/git/jaeger-ui/src/api/jaeger.js:63:12)
    at Object.<anonymous>.exports.fetchServiceOperations.serviceName (/Users/xxx/git/jaeger-ui/src/actions/jaeger-api.js:40:33)
    at finalPayloadCreator (/Users/xxx/git/jaeger-ui/node_modules/redux-actions/lib/createAction.js:37:58)
    at actionCreator (/Users/xxx/git/jaeger-ui/node_modules/redux-actions/lib/createAction.js:44:39)
    at action (/Users/xxx/git/jaeger-ui/src/middlewares/index.js:38:315)
    at Object.<anonymous>.it (/Users/xxx/git/jaeger-ui/src/middlewares/index.test.js:31:476)
    at Object.asyncFn (/Users/xxx/git/jaeger-ui/node_modules/jest-jasmine2/build/jasmine-async.js:68:30)
    at resolve (/Users/xxx/git/jaeger-ui/node_modules/jest-jasmine2/build/queueRunner.js:38:12)
    at new Promise (<anonymous>)
    at mapper (/Users/xxx/git/jaeger-ui/node_modules/jest-jasmine2/build/queueRunner.js:31:21)
    at Promise.resolve.then.el (/Users/xxx/git/jaeger-ui/node_modules/p-map/index.js:46:16)
    at <anonymous>
error Command failed with exit code 1.

Describe the results you expected:
pass all tests

Additional information you deem important (e.g. issue happens only occasionally):
Revert the proxy field modification, and modify the name field to others, run npm test, and got the same error; but npm test is OK when nothing changed.

Additional environment details (Browser, etc.):
None

@tiffon
Copy link
Member

tiffon commented Oct 25, 2017

@NeoCN Thanks for reporting.

I've seen this message before, but as a warning (still not good, but at least passing).

A couple of questions:

  • Did you install with npm or yarn?
  • Can you show the output of npm list | grep fetch?
  • What version of npm and node are you using?

Thanks.

@NeoCN
Copy link
Author

NeoCN commented Oct 25, 2017

@tiffon Both npm and yarn have tried, npm test and yarn test got the same error.

output of npm list | grep fetch is
├─┬ isomorphic-fetch@2.2.1
│ ├─┬ node-fetch@1.7.3
│ └── whatwg-fetch@2.0.3
│ │ ├── isomorphic-fetch@2.2.1 deduped
│ └── whatwg-fetch@2.0.3 deduped
version
  • node: 8.8.0
  • npm: 5.4.2

@NeoCN
Copy link
Author

NeoCN commented Oct 25, 2017

@tiffon after #102 was merged, both npm test and yarn test passed after name and proxy field modification with warn message like

(node:25255) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: only absolute urls are supported
(node:25255) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:25255) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: only absolute urls are supported
(node:25255) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: only absolute urls are supported
(node:25255) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): Error: only absolute urls are supported
(node:25255) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 10): Error: only absolute urls are supported

tiffon added a commit that referenced this issue Oct 25, 2017
Signed-off-by: Joe Farro <joef@uber.com>
tiffon added a commit that referenced this issue Oct 25, 2017
…ute-urls

Fix #105 test error, fetch requires absolute urls
@tiffon
Copy link
Member

tiffon commented Oct 25, 2017

@NeoCN Thanks for the great info. I was sort of able to reproduce the errors by running:

$ yarn test -- -i

The changes just merged into master should sort this issue out.

vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this issue Jul 5, 2021
Signed-off-by: Joe Farro <joef@uber.com>

Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this issue Jul 5, 2021
…t-error-absolute-urls

Fix jaegertracing#105 test error, fetch requires absolute urls
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
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

2 participants