Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Web App (Angular) not working with SPFetchClient #509

Closed
3 tasks
gonadn opened this issue Feb 16, 2019 · 6 comments
Closed
3 tasks

Azure Web App (Angular) not working with SPFetchClient #509

gonadn opened this issue Feb 16, 2019 · 6 comments

Comments

@gonadn
Copy link

gonadn commented Feb 16, 2019

Category

  • Enhancement
  • Bug
  • [*] Question
  • Documentation gap/issue

PnP Version: [
"@pnp/common": "^1.2.9",
"@pnp/graph": "^1.2.9",
"@pnp/logging": "^1.2.9",
"@pnp/nodejs": "^1.2.9",
"@pnp/odata": "^1.2.9",
"@pnp/sp": "^1.2.9",
]

Iam creating Angular (Angular-cli) application hosting on Azure as Azure App Service (WebApp) .
And i want to access data in SharePoint from Angular application using @pnp/nodejs ,
image

when i add code below in my .ts constructor() i get a bunch of errors in console:
image

Errors i get:
image

Anyone had this issue, or am i doing something wrong here?
How can i access data in SharePoint from an application hosted in Azure as a App Service (WebApp) ?

@simonagren
Copy link
Member

This seems to have to do with Angular CLI and Crypto and some changes to how Crypto is being/not being used anymore.

Check out this comment on how you might be able to solve it:
angular/angular-cli#1548 (comment)

@gonadn
Copy link
Author

gonadn commented Feb 17, 2019

hi @simonagren , thanks for your time, i tried the solution descriebed in the article you refer to...

The fix/solution:
image

i got rid of all errors with "crypto", but got another error:
image

@gonadn
Copy link
Author

gonadn commented Feb 17, 2019

the solution was to add net: 'empty' and tyld: 'empty' to web.config.js , as described here: link
your link #1529 had the solution: I needed to add polyfills for node stuff in webpack.config.js, like this:

config.node = {
  console: 'empty',
  fs: 'empty',
  net: 'empty',
  tls: 'empty'
}

Thanks a lot!

@simonagren
Copy link
Member

Was gonna write that one first, but I dint't think it did the trick, haha. @gonadn could you close the issue?

@gonadn gonadn closed this as completed Feb 17, 2019
@gonadn
Copy link
Author

gonadn commented Feb 17, 2019

thanks to @simonagren for refering to article witch helped to fix the issue... 💯

@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants