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
I have been getting an error when trying to use node-sp-auth in sp-rest-proxy in an On Demand configuration
I created a simple node.js package to isolate the the issue. Please see the pakcage.json below the error.
When I traced the error the issue appears to be that childproces.spawnsysnc is getting an EONENT error when tying to create the spawn of electron.
I was able to get a temporary workaround by referring to the absolute path to electron. But when referring to it as just 'electron' the ENOENT error is recieved.
Node Version: 16.15.1
Operating System: Windows 10
Error Recieved:
GET: https://www.sharepoint.com/sites/mysite/
Error TypeError: Cannot read properties of null (reading 'toString')
at OnDemand.saveAuthData (c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\node_modules\node-sp-auth\lib\src\auth\resolvers\OnDemand\OnDemand.js:83:44)
at OnDemand.getAuth (c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\node_modules\node-sp-auth\lib\src\auth\resolvers\OnDemand\OnDemand.js:38:28)
at Object.getAuth (c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\node_modules\node-sp-auth\lib\src\index.js:16:76)
at SPClient.<anonymous> (c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\utils\client.js:69:51)
at step (c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\utils\client.js:44:23)
at Object.next (c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\utils\client.js:25:53)
at c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\utils\client.js:19:71
at new Promise (<anonymous>)
at __awaiter (c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\utils\client.js:15:12)
at SPClient.fetch (C:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\utils\client.js:65:20) {stack: 'TypeError: Cannot read properties of null (re…les\sp-rest-proxy\dist\utils\client.js:65:20)', message: 'Cannot read properties of null (reading 'toString')'}
arg1: TypeError: Cannot read properties of null (reading 'toString')\n at OnDemand.saveAuthData (C:\\Users\\userName\\NodeProjects\\spo-proxy\\node_modules\\sp-rest-proxy\\node_modules\\node-sp-auth\\lib\\src\\auth\\resolvers\\OnDemand\\OnDemand.js:83:44)\n at OnDemand.getAuth (C:\\Users\\userName\\NodeProjects\\spo-proxy\\node_modules\\sp-rest-proxy\\node_modules\\node-sp-auth\\lib\\src\\auth\\resolvers\\OnDemand\\OnDemand.js:38:28)\n at Object.getAuth (C:\\Users\\userName\\NodeProjects\\spo-proxy\\node_modules\\sp-rest-proxy\\node_modules\\node-sp-auth\\lib\\src\\index.js:16:76)\n at SPClient.<anonymous> (C:\\Users\\userName\\NodeProjects\\spo-proxy\\node_modules\\sp-rest-proxy\\dist\\utils\\client.js:69:51)\n at step (C:\\Users\\userName\\NodeProjects\\spo-proxy\\node_modules\\sp-rest-proxy\\dist\\utils\\client.js:44:23)\n at Object.next (C:\\Users\\userName\\NodeProjects\\spo-proxy\\node_modules\\sp-rest-proxy\\dist\\utils\\client.js:25:53)\n at C:\\Users\\userName\\NodeProjects\\spo-proxy\\node_modules\\sp-rest-proxy\\dist\\utils\\client.js:19… …
Logger.error @ c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\utils\logger.js:51:25
<anonymous> @ c:\Users\userName\NodeProjects\spo-proxy\node_modules\sp-rest-proxy\dist\core\BasicRouter.js:118:34
processTicksAndRejections @ internal/process/task_queues:96:5
Hi @yshwartzou I'm having the same issue when I get that TypeError: Cannot read properties of null (reading 'toString'). Were you able to fix your issue? I tried your work around and it still did not work for me
After some research, I found that this error may be related with PR#108. On Windows, if I manually pass {shell:true} as it was on previous code, everything works fine.
I have been getting an error when trying to use node-sp-auth in sp-rest-proxy in an On Demand configuration
I created a simple node.js package to isolate the the issue. Please see the pakcage.json below the error.
When I traced the error the issue appears to be that childproces.spawnsysnc is getting an EONENT error when tying to create the spawn of electron.
I was able to get a temporary workaround by referring to the absolute path to electron. But when referring to it as just 'electron' the ENOENT error is recieved.
Node Version: 16.15.1
Operating System: Windows 10
Error Recieved:
Package.json
Workaround configuration
The text was updated successfully, but these errors were encountered: