[NPMCLI-189] mgnl create-page the templateScript and dialog is set to undefined on Windows Created: 11/Jul/18  Updated: 28/Aug/18  Resolved: 23/Aug/18

Status: Closed
Project: Magnolia CLI
Component/s: None
Affects Version/s: 3.0.1
Fix Version/s: 3.0.3

Type: Bug Priority: Blocker
Reporter: Sven Bach Assignee: Jaroslav Simak
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10


Issue Links:
Relates
relates to NPMCLI-201 Run automated CI tests for the CLI on... Closed
causality
is causing DOCU-1666 Update CLI docs for 3.0.3 Closed
Template:
Acceptance criteria:
Empty
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
Date of First Response:
Epic Link: Starting is easy
Sprint: Kromeriz 159
Story Points: 2

 Description   

CLI produces “undefined” properties on Windows. Specifically the dialog and templateScript properties have the value undefined which makes the templates unusable.

OS:

  • Windows 10

Version: 

Magnolia CLI: 3.0.1 (node.js: v10.4.0)

 
Create light module:

C:\home\projects\magnolia\cli>mgnl create-light-module bucket-list-module
info Using configuration at C:\Users\j.roesler\AppData\Roaming\npm\node_modules\@magnolia\cli\lib\config\mgnl-cli.json
info Using prototypes at C:\Users\j.roesler\AppData\Roaming\npm\node_modules\@magnolia\cli\lib\config\mgnl-cli-prototypes
info 'No path option provided, light module will be created in the current folder.'
info Created C:\home\projects\magnolia\cli\bucket-list-module\webresources\.keep
info Created C:\home\projects\magnolia\cli\bucket-list-module\templates\pages\.keep
info Created C:\home\projects\magnolia\cli\bucket-list-module\templates\components\.keep
info Created C:\home\projects\magnolia\cli\bucket-list-module\dialogs\pages\.keep
info Created C:\home\projects\magnolia\cli\bucket-list-module\dialogs\components\.keep
info Created C:\home\projects\magnolia\cli\bucket-list-module\README.md
info Created C:\home\projects\magnolia\cli\bucket-list-module\includes\README.txt
info Created C:\home\projects\magnolia\cli\bucket-list-module\i18n\bucket-list-module-messages_en.properties
info Created C:\home\projects\magnolia\cli\bucket-list-module\decorations\.keep
info Module bucket-list-module created at C:\home\projects\magnolia\cli\bucket-list-module
info Success! In order to add a page template, run mgnl create-page $YOUR_PAGE_NAME -p C:\home\projects\magnolia\cli\bucket-list-module

Create page:

C:\home\projects\magnolia\cli>cd bucket-list-moduleC:\home\projects\magnolia\cli\bucket-list-module>mgnl create-page bucket-list
info Using configuration at C:\Users\j.roesler\AppData\Roaming\npm\node_modules\@magnolia\cli\lib\config\mgnl-cli.json
info Using prototypes at C:\Users\j.roesler\AppData\Roaming\npm\node_modules\@magnolia\cli\lib\config\mgnl-cli-prototypes
info No path option provided, page template will be created in the current folder.
info Created C:\home\projects\magnolia\cli\bucket-list-module\templates\pages\bucket-list.yaml
info Created C:\home\projects\magnolia\cli\bucket-list-module\dialogs\pages\bucket-list.yaml
info Created C:\home\projects\magnolia\cli\bucket-list-module\templates\pages\bucket-list.ftl
info Page template created

The page .yml configuration:

title: bucket-list
templateScript: undefined
renderType: freemarker
dialog: undefined
visible: true

I also followed the walkthrough from https://documentation.magnolia-cms.com/display/DOCS57/Magnolia+CLI+walkthrough but the result is the same.



 Comments   
Comment by Sven Bach [ 12/Jul/18 ]

I have the same problem with node LTS

Magnolia CLI: 3.0.1 (node.js: v8.11.3)
Comment by Martin Drápela [ 13/Aug/18 ]

Well, the tutorial says to use a create-page command that uses a specific prototype:

mgnl create-page bucket-list -P my-page-prototype

but above in the description I only see this:

C:\home\projects\magnolia\cli>cd bucket-list-moduleC:\home\projects\magnolia\cli\bucket-list-module>mgnl create-page bucket-list

Isn't this the problem?

Comment by Edwin Guilbert [ 13/Aug/18 ]

The issue is produced with only using the basic options, i.e:

mgnl create-page my-page

This would produce a my-page page definition with undefined properties on windows:

dialog: undefined
templateScript: undefined

Ive seen this happened to users with windows 8 too. And also with create-component command.

Generated at Mon Feb 12 04:47:23 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.