Comments (7)
Cool, glad it works. If you know the exact steps taken, please post here, will be useful for others.
from pnp-auth.
- new server uninstalled node 10.15 - re-installed node 8.15
- copy pasted the working project to the new server
- no changes what-so-ever
- run : same error !
AFAIK the only difference now is IISNode installed on the new server
So is IISNode intervening ? (the project is not linked - by me - in any way to IISNode)
If anybody has any pointers ... I'm taking all help I can get :)
thanks
from pnp-auth.
It might be because of IISNode. As in my scenarios 8/10 no matter work.
Unfortunately, I have no experience with IISNode so without taking a look into this have no idea so far.
from pnp-auth.
Out of interest, can you try pnp-auth's predecessors sp-pnp-node or node-pnp-js. Will it fail the same in your environment?
from pnp-auth.
using node-pnp-js : samer error
(node:8256) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token < in JSON at position 1
warning.js:18
at JSON.parse ()
at c:\Services\nodetest2\node_modules\sp-pnp-js\lib\odata\core.js:24:89
This is all the code there is
import * as pnp from 'sp-pnp-js';
import NodeFetchClient from 'node-pnp-js';
var credentials = {
"siteUrl": "https://xxxxxxxxxxxxxxxxx",
"strategy": "AdfsUserCredentials",
"username": "xxxxx@xxxxxx",
"password": "xxxxxx",
"relyingParty": "xxxxxxx",
"adfsUrl": "https://xxxxxxxx",
"adfsCookie": "FedAuth"
}
pnp.setup({
sp: {
fetchClientFactory: () => {
return new NodeFetchClient(credentials);
}
}
});
new pnp.Web(credentials.siteUrl).get()
.then(data => {
console.log(`Your web title: ${data.Title}`);
})
from pnp-auth.
To get rid of "Unexpected token < in JSON at position 1" you should additionally set headers: { "Accept": "application/json; odata=verbose" }
.
Have you tried that?
from pnp-auth.
I've pestered the server admins and they have come with the announcements 'changed something in the host file to avoid wap' ...
Now it works. (all solutions)
Thank you very much for your time, really appreciated.
Maybe worth remembering when others come up with this error ?
from pnp-auth.
Related Issues (10)
- Error with sp.createIsolated() HOT 6
- TypeError: sp.setup is not a function HOT 14
- @pnp v3? HOT 4
- Need for bootstrapping @pnp/sp-taxonomy? HOT 2
- Provide custom fetch
- Compilation error HOT 2
- Compilation Errors - @pnp/sp @pnp/pnpjs ^2.0.3 and pnp-auth HOT 3
- Is a version planned with support for pnp/sp v2? HOT 7
- Module not Working with new NodeJS Version 13.2 on TypeScript HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pnp-auth.