Skip to content

Error with latest version #104

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
saitejayala opened this issue Feb 24, 2020 · 13 comments
Closed

Error with latest version #104

saitejayala opened this issue Feb 24, 2020 · 13 comments
Assignees

Comments

@saitejayala
Copy link

I have updated plotly version today to latest
In my package.json file i have
"angular-plotly.js": "^1.6.0",
"plotly.js": "^1.52.2"

From then it is giving me error on ng build
below is the error:

**ERROR in node_modules/angular-plotly.js/src/app/plotly-via-cdn/plotly-via-cdn.module.d.ts:9:16 - error TS1086: An accessor cannot be declared in an ambient context.

9 static set plotlyVersion(version: string);
~~~~~~~~~~~~~
node_modules/angular-plotly.js/src/app/plotly-via-cdn/plotly-via-cdn.module.d.ts:10:16 - error TS1086: An accessor cannot be declared in an ambient context.

10 static set plotlyBundle(bundle: PlotlyBundleName);
~~~~~~~~~~~~
node_modules/angular-plotly.js/src/app/shared/plotly.service.d.ts:11:9 - error TS1086: An accessor cannot be declared in an ambient context.

11 get debug(): boolean;**

Any idea why this is giving me error

@nicodh
Copy link

nicodh commented Feb 25, 2020

Same here with angular 8.2 & typescript 3.5.3
It works with typescript 3.6 but that is not allowed with angular 8
https://devblogs.microsoft.com/typescript/announcing-typescript-3-6/#get-and-set-accessors-allowed-in-ambient-contexts

@andrefarzat
Copy link
Collaborator

@nicodh @saitejayala as a quickfix, try downgrading angular-plotly.js to version 1.5.0. This is the last version with angular 8.
In parallel, I will investigate why these errors might be happening

@andrefarzat andrefarzat self-assigned this Feb 25, 2020
@tanvi-cota
Copy link

@andrefarzat since we need the treemap/sunburst click event, and facing this issue., the downgrade wont work

@michielkikkert
Copy link

michielkikkert commented Feb 28, 2020

I have the same issue. It seems this library is now compiled using NG9? Is that correct? because that will break support with version 8 Angular apps. If this is the case, this really should have been a major release right?

@andrefarzat
Copy link
Collaborator

@MikeOne looks like you're right. From 7 to 8 wasn't the same issue, but to 9 is having these small (but several) issues which I can't replicate in my tests. Will downgrade to angular 8.x and release a 2.x version to suporte angular 9.x

@andrefarzat
Copy link
Collaborator

@saitejayala @MikeOne @tanvi-cota ok guys, I deprecated versions 1.6.0, 1.6.1, and 1.7.0, downgraded the angular to 8 and published the version 1.8.0. Also, I generated the version 2.0.0 with support to angular 9. Please, test now and let me know if it works correctly now 😸

@michielkikkert
Copy link

Great. I’ll test it asap. For clarification- you really don’t ‘need’ a ng9 version short term. The Angular ngcc compiler will take care of enabling version 8 libraries to work with Ivy for you.

@tanvi-cota
Copy link

@andrefarzat this seems to work now, thanks for the quick fix!

@andrefarzat
Copy link
Collaborator

Closing this issue. Please, feel free to reopen if it persists 😸

@markzolotoy
Copy link

So, as of today should it give any errors while compiling? Because I am getting:
ERROR in node_modules/angular-plotly.js/src/app/plotly-via-cdn/plotly-via-cdn.module.d.ts(9,16): error TS1086: An accessor cannot be declared in an ambient context. node_modules/angular-plotly.js/src/app/plotly-via-cdn/plotly-via-cdn.module.d.ts(10,16): error TS1086: An accessor cannot be declared in an ambient context. node_modules/angular-plotly.js/src/app/shared/plotly.service.d.ts(11,9): error TS1086: An accessor cannot be declared in an ambient context.

What is a way to making it work in Angular 9?

Thanks

@andrefarzat
Copy link
Collaborator

@markzolotoy the correct version to work with angular 9 is 2.x.x. Which version are you using when this error occurs ?

@markzolotoy
Copy link

markzolotoy commented Aug 12, 2020

`Angular CLI: 7.3.10
Node: 10.15.1
OS: win32 x64
Angular: 7.2.16
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.13.10
@angular-devkit/build-angular 0.13.10
@angular-devkit/build-optimizer 0.13.10
@angular-devkit/build-webpack 0.13.10
@angular-devkit/core 7.3.10
@angular-devkit/schematics 7.3.10
@angular/cli 7.3.10
@ngtools/webpack 7.3.10
@schematics/angular 7.3.10
@schematics/update 0.13.10
rxjs 6.6.2
typescript 3.6.5
webpack 4.29.0`

And in angular.json I have this:
scripts": ["node_modules/plotly.js/dist/plotly.min.js"],

@andrefarzat
Copy link
Collaborator

@markzolotoy looks like you're using version 7.2.16. You can update the angular to 8.x and use angular-plotly.js version 1.8.0 or you can use angular 7.x with angular-plotly.js version 1.3.2 (see #79 (comment) )

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

6 participants