_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.
Code for your reference:code.txt
Uncaught TypeError: Cannot read property 'siteAbsoluteUrl' of undefined
Shiv Sharma
1
Reputation point
Uncaught TypeError: Cannot read property 'siteAbsoluteUrl' of undefined
1 answer
Sort by: Most helpful
-
Amos Wu-MSFT 4,051 Reputation points
2020-09-29T07:09:11.363+00:00