-
Notifications
You must be signed in to change notification settings - Fork 233
Error "TS2300: Duplicate identifier 'Promise'" after installing in a SPFx project #221
Comments
What version of the library? If you have updated to 1.0.5 it is targeted to TypeScript 2.0. Did you get a chance to review the release notes post or the updated app setup post? |
There is no longer a post install step, it was removed. We now depend on some of the @types libraries to do the typings where we used to use typings. In what context are you trying to use the library? You haven't given us much to go on in terms of helping you - so the more info you can share the more we can try and help. |
I understand. I am trying to run this library with share point client side framework (SPFX) http://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/build-a-hello-world-web-part This project is with React, Typescript and Gulp all provided in initial setup by Microsoft. Everything use to work fine until yesterday untill I take latest of sp-pnp-js. Task Typescript start throwing error. Just tried to import pnp library , nothing else. This is structure of my node-module sp-pnp-js folder .. It use to add few other folder previously (typings and some typingtheme or something) |
Hmmm...ok, very strange. The change yesterday was definitely the release of 1.0.5 which did change the definition files. Let me grab the very latest of SPFx and see if I can duplicate and I'll get back to you on this. Sorry for the difficulties but thanks for reporting it. We'll see if we can get you sorted out. |
Interesting - so when I pulled latest SPFx it turns out it is still using TypeScript 1.8.* and I was able to duplicate this. Let me see if I can get some clarity on when they will drop the version which uses TS2. I thought we timed this well but seems like not the case. |
Quick update - drop 5 of SPFx has been released and includes TypeScript 2.0, which resolves the above issues. However I am keeping this open as there are now errors related to duplicate definitions. Working with SP Engineering on best approach to make it all work together and will report back when I have something. So still working on it. |
Had a look at this first thing this morning and don't have a perfect fix yet, but if you edit the tsd.d.ts file under "typings" folder in your project and remove/comment out these two lines things start working again as expected:
Will keep this open until we can firm up the entire experience but still working with PG on that. Thanks! |
Tracking: SharePoint/sp-dev-docs#265 |
Hi Patrick, I'm encountering the same error, when trying to include PnP-JS in an existing TS project (it's NOT an SPFx project) where I was previously already using ES6-Promise package, but not PnP-JS. In the screenshot below you can see as soon as I install PnP-JS, I get that error during build. Let me know in case you need more details, or is better if I create a separate issue for this |
@biste5 - I am currently working on dropping the reference to core-js in @types but am blocked as discussed in this thread. I am honestly considering just removing all type information from the npm package and forcing folks to install the typings using whatever system they want. I think that is less than ideal experience but this is turning into a circular problem that fixing one part breaks something for someone else. Had hoped @types was the solution but does not seem to be. |
I am having similar issue, please see #287 i am using tsc v 2.1.4 |
Hi @patrick-rodgers, Joel |
@joelfmrodrigues - thanks for the kind words. I haven't had a chance to work with our latest with RC0 yet - been working on work + refactoring the provisioning library and getting it up in the new repo. So busy days. If you want to test out removing all the @types from sp-pnp-js and see if that builds with RC0 give it a go. My feeling currently is to not package any typing info with the library and document that folks may need to add some depending on their project. There are too many variables it seems to make it all work, so doing nothing might be best. |
Hi @patrick-rodgers I will do my best to give it a try an let you know in case it worked 👍 I'm also super busy at work, but I'm trying to promote SPFx adoption within the team and this package is definitely a must have 🥇 |
Things should now be working fully with RC0 release of SPFx. You will need to pull latest dev branch and ensure you have RC0 installed. If someone could verify it works somewhere other than my machine that would be great. Thanks! |
@patrick-rodgers that was a quick fix! It's working for me 👍 By working I mean that the project compiles without errors. Will try to test better later |
Awesome - thanks @joelfmrodrigues for confirming. Will close this as the last issue before 2.0.0! |
I'm getting this error when trying to run the SPFx project locally. Not sure if it's related |
Category
[ ] Enhancement
[+ ] Bug
[ ] Question
Getting some typings while running application.
Looks like postscript is not running while installing sp-pnp-js module. it use to work fine till yesterday and today something goes wrong.
The text was updated successfully, but these errors were encountered: