Uncaught TypeError: Cannot read property 'siteAbsoluteUrl' of undefined

Shiv Sharma 1 Reputation point MVP
2020-09-19T13:49:26.127+00:00

Uncaught TypeError: Cannot read property 'siteAbsoluteUrl' of undefined25945-error.png

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint Server | Development
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,051 Reputation points
    2020-09-29T07:09:11.363+00:00

    _spPageContextInfo is not defined in SharePoint modern page,so we could not use it in modern page.
    If you are customizing classic page,you need to make sure to use _spPageContextInfo after dom is loaded.If SP.JS file is not loaded that can also cause issue while running _spPageContextInfo command. You can execute command as mentioned below.
    28958-image.png
    Code for your reference:code.txt

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.