Please describe how we can improve the doc page:
import pnp from '@pnp/sp'; throws an error 'no default import'.
It should be changed to import * as pnp from '@pnp/sp';
The same for import { Web } from "@pnp/sp";
It should be like:
import * as pnp from '@pnp/sp';
//...
const web = new pnp.Web('https://contoso.sharepoint.com/sites/web');
Library version: 1.0.3
Thanks, we'll get this updated.
import { Web } from "@pnp/sp"; should work as there is an export "Web".
Yep, for Web it's my bad as I was trying do both in one line:
import pnp, { Web } from '@pnp/sp';
If you change the "pnp" to "sp" and move it inside the braces in your code you should be all set.
import { sp, Web } from "@pnp/sp"
Regardless, thanks for letting us know and we'll get the docs updated for the next release.