You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For support questions, please consider using Gitter - Chat
I am submitting an issue that when I running the following command to prerender some pages ng run demo-angular-project:prerender:development,
I got the following exception:
Build at: 2023-11-16T08:00:28.460Z - Hash: b945708904bd624f - Time: 78602ms
⠙ Prerendering 13 route(s) to D:\dev\proj\demo-angular-project\dist\demo-angular-web\browser...ReferenceError: _hmt is not defined
at new Angulartics2BaiduAnalytics (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:199481:12)
at Object.Angulartics2BaiduAnalytics_Factory [as factory] (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:199536:10)
at D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134269:33
at runInInjectorProfilerContext (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:125777:5)
at R3Injector.hydrate (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134268:9)
at R3Injector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134148:23)
at R3Injector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134157:27)
at ChainedInjector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:138783:32)
at lookupTokenUsingModuleInjector (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:129505:31)
at getOrCreateInjectable (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:129551:10)
✖ Prerendering routes to D:\dev\proj\demo-angular-project\dist\demo-angular-web\browser failed.
_hmt is not defined
Unhandled Promise rejection: _hmt is not defined ; Zone: <root>; Task: Promise.then ; Value: ReferenceError: _hmt is not defined
at new Angulartics2BaiduAnalytics (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:199481:12)
at Object.Angulartics2BaiduAnalytics_Factory [as factory] (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:199536:10)
at D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134269:33
at runInInjectorProfilerContext (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:125777:5)
at R3Injector.hydrate (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134268:9)
at R3Injector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134148:23)
at R3Injector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134157:27)
at ChainedInjector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:138783:32)
at lookupTokenUsingModuleInjector (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:129505:31)
at getOrCreateInjectable (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:129551:10) ReferenceError: _hmt is not defined
at new Angulartics2BaiduAnalytics (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:199481:12)
at Object.Angulartics2BaiduAnalytics_Factory [as factory] (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:199536:10)
at D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134269:33
at runInInjectorProfilerContext (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:125777:5)
at R3Injector.hydrate (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134268:9)
at R3Injector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134148:23)
at R3Injector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:134157:27)
at ChainedInjector.get (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:138783:32)
at lookupTokenUsingModuleInjector (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:129505:31)
at getOrCreateInjectable (D:\dev\proj\demo-angular-project\dist\demo-angular-web\server\main.js:129551:10)
I think when prerendering a page on server side, it's initializing _hmt. which is meaningful. should we skip that if we can detect it's in prerendering process to make the libarary more robust.
bug report
feature request
question about the decisions made in the repository
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
create an angular project and enableing angular universal and do preredering.
What is the expected behavior?
don't throw error if there is no _hmt found in ssr process.
What is the motivation / use case for changing the behavior?
to skip initialize Angulartics2BaiduAnalytics and do nothing during server side rendering.
The text was updated successfully, but these errors were encountered:
guoapeng
changed the title
Angulartics2BaiduAnalytics ReferenceError: _hmt is not defined
prerenderring - Angulartics2BaiduAnalytics ReferenceError: _hmt is not defined
Nov 16, 2023
For support questions, please consider using Gitter - Chat
I am submitting an issue that when I running the following command to prerender some pages
ng run demo-angular-project:prerender:development
,I got the following exception:
I think when prerendering a page on server side, it's initializing _hmt. which is meaningful. should we skip that if we can detect it's in prerendering process to make the libarary more robust.
bug report
feature request
question about the decisions made in the repository
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
create an angular project and enableing angular universal and do preredering.
don't throw error if there is no _hmt found in ssr process.
to skip initialize Angulartics2BaiduAnalytics and do nothing during server side rendering.
please run the following and copy the output
The text was updated successfully, but these errors were encountered: