Code Monkey home page Code Monkey logo

Comments (4)

koltyakov avatar koltyakov commented on June 11, 2024 1

Hi @alirobe,

Any specific reason to import setup from @pnp/common but not from @pnp/sp?

import { sp } from "@pnp/sp";

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

from pnpjs.

patrick-rodgers avatar patrick-rodgers commented on June 11, 2024 1

There are different setup methods in play here. There is a core setup method in common that handles any shared configuration. What you want is the setup method from the @pnp/sp library. That includes the type you expect. @koltyakov 's example above is correct. The sp.setup is an extension of the setup method from common. It works because ultimately the configuration ends up in the same object behind the scenes, you are just lacking the typing.

Docs page shows the use of the sp specific configuration.

from pnpjs.

alirobe avatar alirobe commented on June 11, 2024

OK, I think I read some incorrect guidance somewhere - but I can't remember where, so I think I'll just close this. Fix works. Thanks for the answer :)

from pnpjs.

github-actions avatar github-actions commented on June 11, 2024

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.

from pnpjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.