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

Not compatible with @angular/[email protected] #35

Open
larssn opened this issue Sep 10, 2018 · 7 comments
Open

Not compatible with @angular/[email protected] #35

larssn opened this issue Sep 10, 2018 · 7 comments

Comments

@larssn
Copy link
Contributor

larssn commented Sep 10, 2018

The error is:

You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
  TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    at Object.exports.subscribeTo (/node_modules/@angular/cli/node_modules/rxjs/src/internal/util/subscribeTo.ts:37:11)
    at Object.subscribeToResult (/node_modules/@angular/cli/node_modules/rxjs/src/internal/util/subscribeToResult.ts:18:10)
    at MergeMapSubscriber._innerSub (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/mergeMap.ts:142:14)
    at MergeMapSubscriber._tryNext (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/mergeMap.ts:138:10)
    at MergeMapSubscriber._next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/mergeMap.ts:122:12)
    at MergeMapSubscriber.Subscriber.next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/Subscriber.ts:102:12)
    at MapSubscriber._next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/map.ts:86:22)
    at MapSubscriber.Subscriber.next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/Subscriber.ts:102:12)
    at TapSubscriber._next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/tap.ts:116:22)
    at TapSubscriber.Subscriber.next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/Subscriber.ts:102:12)
    at MergeMapSubscriber.notifyNext (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/mergeMap.ts:155:22)
    at InnerSubscriber._next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)
    at InnerSubscriber.Subscriber.next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/Subscriber.ts:102:12)
    at MapSubscriber._next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/map.ts:86:22)
    at MapSubscriber.Subscriber.next (/node_modules/@angular/cli/node_modules/rxjs/src/internal/Subscriber.ts:102:12)
    at MergeMapSubscriber.notifyNext (/node_modules/@angular/cli/node_modules/rxjs/src/internal/operators/mergeMap.ts:155:22)

It happens on an ngw serve, probably also the other commands.

Downgrading to cli v6.1 fixes it.

@splincode
Copy link
Member

Please add more information

@larssn
Copy link
Contributor Author

larssn commented Sep 10, 2018

I did just that. There's not much to go by.

@ivanpadavan
Copy link
Member

ivanpadavan commented Sep 10, 2018

There is enough to go by. Even up to solve the problem :)

@akaiserg
Copy link

Same problem, I had to fixed the version of cli to 6.1.4. Besides I tried to use @angular-builders/custom-webpack:browser but I got the error "SyntaxError: Unexpected token export" When I was building the app.

@alex88
Copy link

alex88 commented Sep 22, 2018

Not sure if it's an issue just with 6.2.*, I've downgrade just the CLI to 6.1.5 and I get the same error. Angular core/etc version is 6.1.8

Nvm, my problem, forgot to do the setup step

Update 2: after doing the setup and fixing the angular.json for 6.1.x CLI the above error is still there using @angular/cli 6.1.4:

You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
    at Object.exports.subscribeTo (/Users/alex/Projects/project/node_modules/rxjs/src/internal/util/subscribeTo.ts:37:11)
    at Object.subscribeToResult (/Users/alex/Projects/project/node_modules/rxjs/src/internal/util/subscribeToResult.ts:25:10)
    at MergeMapSubscriber._innerSub (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/mergeMap.ts:144:5)
    at MergeMapSubscriber._tryNext (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/mergeMap.ts:138:10)
    at MergeMapSubscriber._next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/mergeMap.ts:122:12)
    at MergeMapSubscriber.Subscriber.next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/Subscriber.ts:104:12)
    at MapSubscriber._next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/map.ts:86:22)
    at MapSubscriber.Subscriber.next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/Subscriber.ts:104:12)
    at TapSubscriber._next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/tap.ts:116:22)
    at TapSubscriber.Subscriber.next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/Subscriber.ts:104:12)
    at MergeMapSubscriber.notifyNext (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/mergeMap.ts:157:22)
    at InnerSubscriber._next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/InnerSubscriber.ts:17:17)
    at InnerSubscriber.Subscriber.next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/Subscriber.ts:104:12)
    at MapSubscriber._next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/map.ts:86:22)
    at MapSubscriber.Subscriber.next (/Users/alex/Projects/project/node_modules/rxjs/src/internal/Subscriber.ts:104:12)
    at MergeMapSubscriber.notifyNext (/Users/alex/Projects/project/node_modules/rxjs/src/internal/operators/mergeMap.ts:157:22)

Update 3:

The trick was to downgrade @angular-devkit/build-angular to 0.6.7 (as the package.json of this tool suggests), this solves the above issue but creates this in the ngw.config.ts file:

export default function (config, options) {
^^^^^^

SyntaxError: Unexpected token export
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Module.m._compile (/Users/alex/Projects/project/node_modules/ngw/node_modules/ts-node/src/index.ts:400:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/alex/Projects/project/node_modules/ngw/node_modules/ts-node/src/index.ts:403:12)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at BrowserBuilder.configClasses.(anonymous function).(anonymous function).configClasses.(anonymous function).buildConfig (/Users/alex/Projects/project/node_modules/ngw/lib/index.js:31:31)
    at Observable.rxjs_1.Observable.obs [as _subscribe] (/Users/alex/Projects/project/node_modules/@angular-devkit/build-angular/src/dev-server/packages/angular_devkit/build_angular/src/dev-server/index.ts:115:46)
    at Observable._trySubscribe (/Users/alex/Projects/project/node_modules/rxjs/src/internal/Observable.ts:223:19)
    at Observable.subscribe (/Users/alex/Projects/project/node_modules/rxjs/src/internal/Observable.ts:204:14)

@larssn could you please post your package.json to see which of your dependencies fixes the problem?

Update 4:

Changing "module": "es2015", to "module": "commonjs", fixed the unexpected token export issue

@n-lavrenko
Copy link

n-lavrenko commented Oct 15, 2018

Thank you @alex88 for the Update 4

@millerf
Copy link

millerf commented Feb 14, 2019

I just got the same problem with angular 7:


Angular CLI: 7.3.1
Node: 11.6.0
OS: darwin x64
Angular: 7.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.1
@angular-devkit/build-angular     0.13.1
@angular-devkit/build-optimizer   0.13.1
@angular-devkit/build-webpack     0.13.1
@angular-devkit/core              7.3.1
@angular-devkit/schematics        7.3.1
@angular/cli                      7.3.1
@ngtools/webpack                  7.3.1
@schematics/angular               7.3.1
@schematics/update                0.13.1
rxjs                              6.4.0
typescript                        3.2.4
webpack                           4.29.0
    

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

7 participants