Fix SharePoint Framework Hello World WebPart

Hello everyone,

Today I will talk about an error that may occur when you try to follow the SharePoint Framework tutorial to create the HelloWorld webpart: https://dev.office.com/sharepoint/docs/spfx/web-parts/get-started/build-a-hello-world-web-part

Problematic

When you follow the tutorial, using the “gulp serve” command generates the following errors

Error - typescript - node_modules\@types\lodash\index.d.ts(8446,32): error TS1005: ',' expected.
Error - typescript - node_modules\@types\es6-collections\index.d.ts(78,29): error TS2304: Cannot find name 'object'.

 

Cause

The SharePoint Framework evolved very quickly in a very short time. You may have a template version that is not up to date.

Resolution

To resolve these errors, simply get the last version of the template with the following command

npm install -g @microsoft/generator-sharepoint@latest

If it is not enough,  install the correct versions of lodash and es6-collection via the following commands

npm install @types/lodash@4.14.50
npm install @types/es6-collections@0.5.29

Hoping this helps

Christopher.

SyntaxError Unexpected token in JSON at position 0

Hello everyone,

Today I will talk about a problem concerning the use of PNP JS Core on an environment 2013 OnPremise.

Problematic

Like many I started using PNP JS Core for my developments. After retrieving some information and doing some conclusive tests on an Office 365 environment, I wanted to reuse my code on a SharePoint 2013 OnPremise.

And there .. Boom!

SyntaxError: Unexpected token < in JSON at position 0

The code does not have anything complicated, it will only read the contents of a list.

Reason

Looking a bit, I saw that the return of the REST call was XML and not JSON. It seems that this comes from the basic configuration of SharePoint 2013 SP1 https://github.com/SharePoint/PnP-JS-Core/issues/125

Resolution

The solution to this problem is to pass a configuration before making the call: https://github.com/SharePoint/PnP-JS-Core/pull/127

pnp.setup({
        headers: {
            "Accept": "application/json; odata=verbose"
        }
    });

Simple but when you start using PNP JS it can be useful to know.

Hoping it helps.

NB : Thanks to Yannick for helping the noobie I was in this situation !

Christopher.

Start SharePoint 2010 Development


Hello everybody,

Today I suggest a list of useful msdn links for people who want to start developing SharePoint 2010.

SharePoint 2010 Development Basics Technical Articles :

http://msdn.microsoft.com/en-us/library/hh127069

SharePoint 2010 Visual How Tos :

http://msdn.microsoft.com/en-us/library/ff598601

SharePoint Development in Visual Studio :

http://msdn.microsoft.com/fr-fr/library/ee330921.aspx

SharePoint 2010 101 Code Samples :

http://code.msdn.microsoft.com/office/SharePoint-2010-101-Code-da251182

Not forgetting of course the msdn development forum where you can find a lot of answers!

http://social.msdn.microsoft.com/Forums/en-us/category/sharepoint

As a bonus, a very usefull post describing how to create a full environment : http://andreasglaser.net/post/2010/09/30/Install-SharePoint-e28093-Or-a-wrap-up-of-my-SharePoint-2010-installation-guide.aspx

Happy coding !

Christopher.