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

2.0.2 missing ReadableStream #10708

Closed
xenoterracide opened this issue Sep 4, 2016 · 9 comments
Closed

2.0.2 missing ReadableStream #10708

xenoterracide opened this issue Sep 4, 2016 · 9 comments

Comments

@xenoterracide
Copy link

TypeScript Version: 2.0.2

here's a link to the SO that lead to me filing this http://stackoverflow.com/q/39318707/206466

I started going through my dev dependencies one by one until my code passed, and it worked when I forced my version from ^2.0.0 to 2.0.0 which prevented the 2.0.2 upgrade. If it helps here's my package.json

{
  "name": "rpf",
  "version": "0.1.12",
  "description": "Role Playing Facilitation",
  "main": "dist/app.bundle.js",
  "productName": "Role Playing Facilitator",
  "private": true,
  "scripts": {
    "test": "cross-env NODE_ENV=test ./node_modules/karma/bin/karma start test/karma.conf.js",
    "webdriver:update": "cross-env ./node_modules/.bin/webdriver-manager update",
    "webdriver:start": "cross-env ./node_modules/.bin/webdriver-manager start",
    "pree2e": "npm run webdriver:update -- --standalone",
    "e2e": "concurrently --kill-others \"npm run e2e:start-when-ready\" \"cross-env WEBPACK_PORT=19876 npm start\"",
    "e2e:start-when-ready": "wait-on --timeout 20000 http-get://localhost:19876/index.html && npm run e2e:start",
    "e2e:start": "cross-env ./node_modules/.bin/protractor test/protractor.conf.js",
    "e2e:live": "npm run e2e:start -- --elementExplorer",
    "clean": "npm cache clean && rimraf node_modules test/coverage dist",
    "clean:dist": "rimraf dist",
    "preclean:install": "npm run clean",
    "clean:install": "npm set progress=false && npm install",
    "preclean:start": "npm run clean",
    "clean:start": "npm start",
    "watch": "npm run watch:dev",
    "watch:dev": "npm run build:dev -- --watch",
    "watch:dev:hmr": "npm run watch:dev -- --hot",
    "watch:test": "npm run test -- --auto-watch --no-single-run",
    "watch:prod": "npm run build:prod -- --watch",
    "build": "cross-env NODE_ENV=development npm run build:dev",
    "prebuild:dev": "npm run clean:dist",
    "build:dev": "cross-env NODE_ENV=development npm run webpack -- --progress --profile",
    "prebuild:prod": "npm run clean:dist",
    "build:prod": "cross-env NODE_ENV=production npm run webpack --verbose --display-error-details --profile",
    "start": "npm run server:dev",
    "server": "npm run server:dev",
    "server:dev": "cross-env NODE_ENV=development node ./node_modules/webpack-dev-server/bin/webpack-dev-server --inline --progress --profile --watch",
    "server:dev:hmr": "npm run server:dev -- --hot",
    "server:prod": "http-server dist --cors",
    "webpack": "cross-env ./node_modules/.bin/webpack",
    "webpack-dev-server": "cross-env ./node_modules/.bin/webpack-dev-server"
  },
  "repository": {
    "type": "git",
    "url": "git@bitbucket.org:xenworks/rpf-ui.git"
  },
  "keywords": [
    "aurelia",
    "webpack"
  ],
  "license": "NONE",
  "author": "Caleb Cushing <xenoterracide@gmail.com>",
  "bugs": {
    "url": "https://tree.taiga.io/project/xenoterracide-rpf/issues"
  },
  "homepage": "https://bitbucket.org/xenworks/rpf-ui/overview",
  "aurelia": {
    "build": {
      "resources": []
    }
  },
  "dependencies": {
    "@types/whatwg-fetch": "^0.0.27",
    "aurelia-bootstrapper-webpack": "^1.0.0",
    "aurelia-event-aggregator": "^1.0.0",
    "aurelia-fetch-client": "^1.0.0",
    "aurelia-framework": "^1.0.0",
    "aurelia-history-browser": "^1.0.0",
    "aurelia-loader-webpack": "^1.0.0",
    "aurelia-logging-console": "^1.0.0",
    "aurelia-pal-browser": "^1.0.0",
    "aurelia-polyfills": "^1.0.0",
    "aurelia-route-recognizer": "^1.0.0",
    "aurelia-router": "^1.0.2",
    "aurelia-templating-binding": "^1.0.0",
    "aurelia-templating-resources": "^1.0.0",
    "aurelia-templating-router": "^1.0.0",
    "bluebird": "^3.4.1",
    "bootstrap": "^3.3.7",
    "font-awesome": "^4.6.3",
    "isomorphic-fetch": "^2.2.1",
    "jquery": "^3.1.0",
    "whatwg-fetch": "^1.0.0"
  },
  "devDependencies": {
    "@easy-webpack/config-aurelia": "^2.0.1",
    "@easy-webpack/config-babel": "^2.0.2",
    "@easy-webpack/config-common-chunks-simple": "^2.0.1",
    "@easy-webpack/config-copy-files": "^1.0.0",
    "@easy-webpack/config-css": "^2.3.2",
    "@easy-webpack/config-env-development": "^2.1.1",
    "@easy-webpack/config-env-production": "^2.1.0",
    "@easy-webpack/config-external-source-maps": "^2.0.1",
    "@easy-webpack/config-fonts-and-images": "^1.2.1",
    "@easy-webpack/config-generate-index-html": "^2.0.1",
    "@easy-webpack/config-global-bluebird": "^1.2.0",
    "@easy-webpack/config-global-jquery": "^1.2.0",
    "@easy-webpack/config-global-regenerator": "^1.2.0",
    "@easy-webpack/config-html": "^2.0.2",
    "@easy-webpack/config-json": "^2.0.2",
    "@easy-webpack/config-source-map-support": "^1.0.0",
    "@easy-webpack/config-test-coverage-istanbul": "^2.0.2",
    "@easy-webpack/config-tslint": "^2.0.2",
    "@easy-webpack/config-typescript": "^2.1.2",
    "@easy-webpack/config-uglify": "^2.1.0",
    "@easy-webpack/core": "^1.3.2",
    "@types/bluebird": "^2.0.29",
    "@types/jasmine": "^2.2.30",
    "@types/whatwg-fetch": "0.0.27",
    "aurelia-tools": "^0.2.4",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-es2015-loose": "^7.0.0",
    "babel-preset-es2015-loose-native-modules": "^1.0.0",
    "babel-preset-stage-1": "^6.5.0",
    "babel-register": "^6.11.6",
    "concurrently": "^2.2.0",
    "cross-env": "^2.0.0",
    "http-server": "^0.9.0",
    "jasmine-core": "^2.4.1",
    "karma": "^1.1.2",
    "karma-chrome-launcher": "^1.0.1",
    "karma-coverage": "^1.1.1",
    "karma-jasmine": "^1.0.2",
    "karma-mocha-reporter": "^2.0.4",
    "karma-phantomjs-launcher": "^1.0.1",
    "karma-remap-istanbul": "^0.1.1",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-webpack": "^1.7.0",
    "protractor": "^4.0.0",
    "rimraf": "^2.5.4",
    "ts-node": "^1.2.1",
    "typescript": "^2.0.0",
    "typings": "^1.3.3",
    "wait-on": "^1.5.2",
    "webpack": ">=2.1.0-beta.18 || ^2.1.0",
    "webpack-dev-server": ">=2.1.0-beta.0 || ^2.1.0"
  },
  "babel": {
    "presets": [
      "es2015",
      "stage-1"
    ]
  },
}

Expected behavior:

'ReadableStream' to be present

Actual behavior:

 [default] C:\Users\xeno\IdeaProjects\rpf-ui\typings\globals\whatwg-fetch\index.d.ts:88:11 
     Cannot find name 'ReadableStream'.

sorry if this isn't a bug in typescript, it looks like that, but I'm still rather a novice in this toolchain.

@watzon
Copy link

watzon commented Sep 5, 2016

Looks like you may be missing the package @types/node which contains all of the typings, including ReadableStream, that are node specific. Try installing that and see if it fixes your problem :)

@xenoterracide
Copy link
Author

hmm...

       cjs require whatwg-fetch [isomorphic-fetch] ./~/isomorphic-fetch/fetch-npm-browserify.js 5:0-23
       [] -> factory:198ms building:256ms dependencies:2ms = 456ms

ERROR in [default] /pipeline/source/custom_typings/fetch.d.ts:1:0 
File '/pipeline/source/node_modules/@types/whatwg-fetch/index.d.ts' not found.

ERROR in [default] /pipeline/source/typings/globals/whatwg-fetch/index.d.ts:88:10 
Cannot find name 'ReadableStream'.

typings.json

{
  "globalDependencies": {
    "node": "registry:dt/node#6.0.0+20160831021119",
    "whatwg-fetch": "registry:dt/whatwg-fetch#0.0.0+20160829180742"
  }
}

and into package.json as deps/devdeps

    "@types/node": "^6.0.38",

actually not sure those are the same thing, I know doing the typings install is what fixed a bunch of fetch api missing errors.

@watzon
Copy link

watzon commented Sep 5, 2016

@xenoterracide so you should switch to the new Typings system instead of using the typingspackage. Any typings you want to install can be installed with npm install --save-dev @types/type-name. So in your case you need to install @types/node and @types/whatwg-fetch and get rid of your typings.json file and your typings directory.

@thorn0
Copy link

thorn0 commented Sep 5, 2016

This ReadableStream interface used by the Fetch API has nothing to do with Node. It's part of the Streams API https://streams.spec.whatwg.org/

@saschanaz
Copy link
Contributor

Ultimately you should switch to @types when it gets stable, but before that you should add whatwg-stream type which whatwg-fetch type depends on. This is added by DefinitelyTyped/DefinitelyTyped#10838.

@xenoterracide
Copy link
Author

xenoterracide commented Sep 5, 2016

ok fixed, thanks guys. but what changed here? were these in core then removed? or?

for doc purposes (if someone else find this) here's what I did added these to typings.json

{
  "globalDependencies": {
    "whatwg-fetch": "registry:dt/whatwg-fetch#0.0.0+20160829180742",
    "whatwg-streams": "registry:dt/whatwg-streams#0.0.0+20160829180742"
  }
}

and removed @types/whatwg-fetch from package.json and changed this file fetch.d.ts (provided by aurelia skeleton, to not import from @types/whatwg-fetch and simply be as follows

interface URLSearchParams {}
declare module "isomorphic-fetch" {
  export = fetch;
}

@thorn0
Copy link

thorn0 commented Sep 5, 2016

@xenoterracide That's how Typings works with type definitions from DefinitelyTyped. See typings/typings#227

@xenoterracide
Copy link
Author

hmm well, I didn't actually need typings prior to whatever prompted aurelia/fetch-client#65, so weird, but I guess whatever works at least I'm back in business with my own problems. again, thanks

@Paul21CP
Copy link

What worked for me was installing the whatwg-streams definition:

typings install dt~whatwg-streams --global --save

That installed the entry into typings.json:

"globalDependencies": { "whatwg-fetch": "registry:dt/whatwg-fetch#0.0.0+20160829180742", "whatwg-streams": "registry:dt/whatwg-streams#0.0.0+20160829180742" }

as has been described as the end goal here.

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants