[MGNLFE-331] vue2-editor - global.mgnlInPageEditor in SSR Created: 20/Sep/22  Updated: 20/Sep/22

Status: Open
Project: Magnolia Frontend Helpers
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Low
Reporter: Mykola Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
[ ]* no errors in console
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled

 Description   

Steps to reproduce

  1. Clone minimal-headless-demo
  2. Go to /spa/nuxtjs-ssr-minimal
  3. Install dependencies
  4. Run with npm run dev

Expected results

no errors in console

Actual results

For SSR, please set 'global.mgnlInPageEditor' to true when you need to render edit bars, and false when not.

Workaround

Development notes

It seems like it's not blocking rendering of the page, so it's good

Edit mode is not affected either (I can still see green bars and edit the page)
Only this strange error is appearing in console

Exception origin: https://git.magnolia-cms.com/projects/MODULES/repos/frontend-helpers/browse/packages/template-annotations/src/service/EditorContextHelper.js#39

Probably related to: https://jira.magnolia-cms.com/browse/MGNLFE-118
and PersonalizationService.getVariant()

Demo doesn't have global.mgnlInPageEditor set in page. Providing such variable in asyncData, setup callback, middleware or plugin seems to not making any effect
switching global to globalThis not helping also


Generated at Mon Feb 12 05:46:22 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.