ApostropheCMS integrate pieces

120 Views Asked by At

when i try to extend apostrophe-pieces-pages in some module it throws an error and the same thing hapend when i try to extend apostrophe-pieces

  my app.js :

 'products': {},
 'products-pages': {
      extend: 'apostrophe-pieces-pages'
  }


error :


C:\Users\User\Desktop\NodeJS\foodger\node_modules\apostrophe\index.js:78
    throw err;
    ^

TypeError: Cannot read property 'length' of undefined
at Object.self.cssName 
(C:\Users\User\Desktop\NodeJS\foodger\node_modules\apostrophe\lib\modules\apostrophe- 
utils\lib\api.js:140:28)
at construct 
(C:\Users\User\Desktop\NodeJS\foodger\node_modules\apostrophe\lib\modules\apostrophe-pieces- 
pages\index.js:50:42)
at construct (C:\Users\User\Desktop\NodeJS\foodger\node_modules\moog\index.js:278:21)
at C:\Users\User\Desktop\NodeJS\foodger\node_modules\moog\index.js:288:22
at C:\Users\User\Desktop\NodeJS\foodger\node_modules\async\lib\async.js:181:20
at iterate (C:\Users\User\Desktop\NodeJS\foodger\node_modules\async\lib\async.js:262:13)
at Immediate.<anonymous> 
(C:\Users\User\Desktop\NodeJS\foodger\node_modules\async\lib\async.js:274:29)
at Immediate.<anonymous> 
(C:\Users\User\Desktop\NodeJS\foodger\node_modules\async\lib\async.js:44:16)
at processImmediate (internal/timers.js:461:21)
1

There are 1 best solutions below

0
On

It looks like your new piece type might not have a name property. If you add that as shown in the docs I think it should work out. https://docs.apostrophecms.org/core-concepts/reusable-content-pieces/reusable-content-with-pieces.html#creating-a-directory-of-people-with-pieces