문제

I am new to PnP JS and I want to try it.

Part my code:

import pnp from "sp-pnp-js";
...
pnp.sp.web.select('Title').get()
 .then((data) => console.log(data))

But I got an error in console:

Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse () at core.js:34

enter image description here

도움이 되었습니까?

해결책

You can use configure to:

Sets custom options for current object and all derived objects accessible via chaining.

You can read more about it and find some good examples in below official documentation:

PnP JS - public methods - configure.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top