Uncaught TypeError: Cannot read property 'siteAbsoluteUrl' of undefined

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

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

SharePoint Server
SharePoint Server
A family of Microsoft on-premises document management and storage systems.
1,465 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,349 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,364 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amos Wu-MSFT 4,021 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

    No comments