pnp / pnpjs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
https://pnp.github.io/pnpjs/
Other
753 stars 305 forks source link

docs: fix example minimal local debug config #2948

Closed krystianfowler closed 5 months ago

krystianfowler commented 6 months ago

Category

What's in this Pull Request?

Setting up the repository for the first time I noticed that using the minimal settings from the current docs gives the following error:

1) "before all" hook: setup in "{root}": ReferenceError: module is not defined in ES module scope This file is being treated as an ES module because it has a '.js' file extension and '/Users/krystianfowler/projects/pnpjs/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension. at file:///Users/krystianfowler/projects/pnpjs/settings.js:72:1 at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

This PR converts the minimal settings example to ES module so that the issue above doesn't occur.

patrick-rodgers commented 6 months ago

Can you share the steps to repro the issue you aim to fix with this PR?

bcameron1231 commented 5 months ago

Thank you!