You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for await (const items of this._sp.web.lists.getByTitle("BigList").items.top(1000)) { console.log(items.length); }
Expected or Desired Behavior
Fetching data with the async iterator pattern as decribed here should work
Observed Behavior
Fetching SharePoint-Online List-Items with the async iterator pattern does not work.
Visual Code is showing this message:
Type 'IItems' is not an array type or a string type.ts(2495)
(method) _SPCollection<any[]>.top(top: number): IItems
Steps to Reproduce
Add a new SPFx-Webpart project with React
Install the latest pnp npm i @pnp/sp which is currently 4.7.0
Create some Code to fetch SharePoint-Online List-Items with the async iterator pattern as described in your specification.
The text was updated successfully, but these errors were encountered:
Hmm, just tested and things appear to be working. Have you tried to run it and gotten an error or is this only something showing in vscode? Wondering if it's just a typing issue with something not loaded.
Major Version
4.x
Minor Version Number
4.7.5
Target environment
SharePoint Framework
Additional environment details
This is my package.json:
{
"name": "measures-dk",
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=16.13.0 <17.0.0 || >=18.17.1 <19.0.0"
},
"main": "lib/index.js",
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test"
},
"dependencies": {
"@fluentui/react": "^8.106.4",
"@microsoft/sp-component-base": "1.18.2",
"@microsoft/sp-core-library": "1.18.2",
"@microsoft/sp-lodash-subset": "1.18.2",
"@microsoft/sp-office-ui-fabric-core": "1.18.2",
"@microsoft/sp-property-pane": "1.18.2",
"@microsoft/sp-webpart-base": "1.18.2",
"@pnp/sp": "^4.7.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"tslib": "2.3.1"
},
"devDependencies": {
"@microsoft/eslint-config-spfx": "1.18.2",
"@microsoft/eslint-plugin-spfx": "1.18.2",
"@microsoft/rush-stack-compiler-4.7": "0.1.0",
"@microsoft/sp-build-web": "1.18.2",
"@microsoft/sp-module-interfaces": "1.18.2",
"@rushstack/eslint-config": "2.5.1",
"@types/react": "17.0.45",
"@types/react-dom": "17.0.17",
"@types/webpack-env": "~1.15.2",
"ajv": "^6.12.5",
"eslint": "8.7.0",
"eslint-plugin-react-hooks": "4.3.0",
"gulp": "4.0.2",
"typescript": "4.7.4"
}
}
And this is the Code-Line:
for await (const items of this._sp.web.lists.getByTitle("BigList").items.top(1000)) { console.log(items.length); }
Expected or Desired Behavior
Fetching data with the async iterator pattern as decribed here should work
Observed Behavior
Fetching SharePoint-Online List-Items with the async iterator pattern does not work.
Visual Code is showing this message:
Type 'IItems' is not an array type or a string type.ts(2495)
(method) _SPCollection<any[]>.top(top: number): IItems
Steps to Reproduce
Add a new SPFx-Webpart project with React
Install the latest pnp
npm i @pnp/sp
which is currently 4.7.0Create some Code to fetch SharePoint-Online List-Items with the async iterator pattern as described in your specification.
The text was updated successfully, but these errors were encountered: