xieziyu / ngx-echarts

An angular (ver >= 2.x) directive for ECharts (ver >= 3.x)
https://xieziyu.github.io/ngx-echarts/
MIT License
1.11k stars 197 forks source link

Hi I have upgraded to Angular 6 and Rxjs 6 and I am now getting this error when using ngx-excharts #142

Closed devamondos closed 6 years ago

devamondos commented 6 years ago

rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__.Observable.of is not a function at ChangeFilter.push../node_modules/ngx-echarts/ngx-echarts.es5.js.ChangeFilter.notEmpty (ngx-echarts.es5.js:30) at NgxEchartsDirective.push../node_modules/ngx-echarts/ngx-echarts.es5.js.NgxEchartsDirective.ngOnChanges (ngx-echarts.es5.js:113) at checkAndUpdateDirectiveInline (core.js:9239) at checkAndUpdateNodeInline (core.js:10507) at checkAndUpdateNode (core.js:10469) at debugCheckAndUpdateNode (core.js:11102) at debugCheckDirectivesFn (core.js:11062) at Object.eval [as updateDirectives] (DataDonutComponent.html:2) at Object.debugUpdateDirectives [as updateDirectives] (core.js:11054) at checkAndUpdateView (core.js:10451)

gunpal5 commented 6 years ago

I have same issue.

devamondos commented 6 years ago

Any chance we can get an update on whether this will be looked at? I have re-tried the upgrade and the issue still persists. If this is blocking me for much longer then I will have to change.

xieziyu commented 6 years ago

@shaneamondos Could you provide your ngx-echarts version number? Did you upgrade ngx-echarts for Angular 6?

BhavinPatel04 commented 6 years ago

Seems like there is an issue with rxjs

if it helps anyone, for me, downgrading rxjs & rxjs-compact to exact 6.2.2 as per this comment solved the issue for now

devamondos commented 6 years ago

ngx-echarts: 2.3.1 echarts: 4.1.0 @types/echarts: 4.1.1

Sorry I've only just noticed that ngx-echarts wasn't the most recent one. I was looking at the echarts version.

I have now downloaded 4.0.0 for ngx-echarts but I now get a different error on build and found that someone already raised this issue #143. The solution for him was to set the baseUrl in his tsconfig file but this is already set in mine and I am still getting this issue.

ERROR in ./node_modules/ngx-echarts/fesm5/ngx-echarts.js Module not found: Error: Can't resolve 'C:\PROJECT_LOCATION\src\node_modules\echarts\dist\echarts.min.js' in 'C:\PROJECT_LOCATION\node_modules\ngx-echarts\fesm5'

Seems like its going into the src directory when it don't want it to

xieziyu commented 6 years ago

@shaneamondos

  1. Did you remove echarts script in angular.json?
  2. What's the baseUrl in your tsconfig.json?
  3. What's the path for echarts in your tsconfig.json?
devamondos commented 6 years ago
  1. Yes
  2. "baseUrl": "./",
  3. "echarts": [ "node_modules/echarts/dist/echarts.min.js" ]
{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ],
    "baseUrl": "./",
    "paths": {
      "echarts": [
        "node_modules/echarts/dist/echarts.min.js"
      ]
    },
    "module": "es2015"
  }
}

Update!: So I managed to fix it by updating the baseUrl to 'src' and the echarts path so it started with '../'. I can't really wrap my head around why it now works that way as my tsconfig file is in the same directory as my node_modules but ohh well it works. Thanks for your help.

MatiasChao commented 5 years ago

Hello, i have the same problem.

ngx-echarts: 2.3.1 echarts: 4.2.0

Note: I add the correct address (echart in tsconfig.json) but it says it's wrong (the direction). "baseUrl": "./", "paths": { "echarts": [ "./node_modules/echarts/dist/echarts.min.js" ] }

ERROR in src/groups/groups.ts(19,30): error TS2306: File '......../webapp/node_modules/echarts/dist/echarts.min.js' is not a module. src/groups/groups.ts(21,25): error TS2306: File '....../webapp/node_modules/echarts/dist/echarts.min.js' is not a module.

Any ideas? Thanks