Skip to content

Error when building against 1.4.x: export 'ɵɵdefineInjectable' was not found in '@angular/core' #79

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

Closed
niklaskarl opened this issue Sep 9, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@niklaskarl
Copy link

There seems to be an issue with versions 1.4.x. When upgrading the project to these versions I get the following warning when building with Angular 7.2 which ultimately leads to an runtime error in the browser.

WARNING in ./node_modules/angular-plotly.js/fesm5/angular-plotly.js.js 128:36-54
export 'ɵɵdefineInjectable' was not found in '@angular/core'

Opening this file I find the import with the strange 'ɵ' characters.

@andrefarzat
Copy link
Collaborator

Hello, @niklaskarl . I believe this is an angular issue related to what versions you have installed. Mind posting the package.json here ?
also, is this a fresh install?

@andrefarzat andrefarzat added the bug Something isn't working label Sep 9, 2019
@rbschiefer
Copy link

rbschiefer commented Sep 10, 2019

I have the same issue after setting up a fresh project with angular cli 7.3.8... also tried updating to angular version 8.2.5 (current stable): issue remains.

{
  "name": "plotly-test",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "angular-plotly.js": "^1.4.2",
    "core-js": "^2.5.4",
    "plotly.js": "^1.49.4",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.8",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/node": "~8.9.4",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.2.2"
  }
}

@andrefarzat
Copy link
Collaborator

@niklaskarl @rbschiefer still believe this is an angular issue. I already reported a similar error in a another package before: Nolanus/ngx-page-scroll#363

Maybe uninstalling and installing the libraries with current versions might fix regarding this: angular/angular#30413 (comment)

@TajMahPaul
Copy link

I was having the same issue with 1.4.x and angular 7. I had to use 1.3.2 for it to work with angular 7.

@rbschiefer
Copy link

@andrefarzat uninstalling/installing libraries did not work!
@TajMahPaul thx, going back version of angular-plotly to 1.3.2 solved my issue, but is only a workaround I guess!

@TajMahPaul
Copy link

@andrefarzat uninstalling/installing libraries did not work!
@TajMahPaul thx, going back version of angular-plotly to 1.3.2 solved my issue, but is only a workaround I guess!

It seems like v1.4.x is dependant on angular 8 and v1.3.2 on angular 7. Can you comment @andrefarzat ? In angular 8 I know they renamed defineInjectable to ɵɵdefineInjectable. Hence, the discrepancy.

@andrefarzat
Copy link
Collaborator

@TajMahPaul you're right about the dependencies. And true that they renamed
defineInjectable to ɵɵdefineInjectable.
With this scenario, looks like we should have two versions ( one angular-plotly.js for angular 7.x and another for 8.x). What do you suggest we should do?

petspets pushed a commit to sergmain/metaheuristic-angular that referenced this issue Sep 20, 2019
@TajMahPaul
Copy link

@andrefarzat I would suggest making it clear somewhere in your documentation which version is recommended for version 'x' of angular. Maybe make it part of the npm install process? I can help with whatever you think is best.

@andrefarzat
Copy link
Collaborator

Just added a note on the FAQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants