2

I've created and successfully tested custom activity type in Sitecore 9.0.0 according to this guide: https://doc.sitecore.net/developers/xp/marketing-automation/activities/activity-types/add-activity-type-to-ui.html

But when I deploy exactly the same code to Sitecore 9.0.1 and click on my custom action, JavaScript error occurs:

vendor.6be6958dbf1b66c98060.bundle.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'map' of null TypeError: Cannot read property 'map' of null at de (vendor.6be6958dbf1b66c98060.bundle.js:1) at _n (vendor.6be6958dbf1b66c98060.bundle.js:1) at l.dn (vendor.6be6958dbf1b66c98060.bundle.js:1) at View_ReadonlyEditorComponent_Host_0 (readonly-editor.component.ngfactory.ts:37)

I've also tried out a few examples from blog posts, i.e. https://www.brimit.com/blog/sitecore-marketing-automation-creating-activity-editor but none of them works on Sitecore 9.0.1, all of them fail with exact same error when I click on action and editor loads.

Has anyone managed to get custom activity type working on Sitecore 9.0.1?

2

I have checked birmit's blog, actually you have to update angular dependency to 5.

package.json is =>

{
  "name": "demo9.features.sendemailpromo",
  "version": "0.0.0",
  "description": "Sitecore 9 Marketing Automation Demo",
  "private": true,
  "angular-cli": {},
  "scripts": {
    "predev": "npm install && rimraf ./codegen/",
    "dev": "ngc -p ./src/tsconfig.aot.json && npm run build",
    "prebuild": "rimraf ./dist/",
    "build": "webpack --display-error-details"
  },
  "dependencies": {
    "@angular/common": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/platform-browser": "5.2.9",
    "@ngx-translate/core": "10.0.1",
    "@sitecore/ma-core": "file:C:/Website/sitecore/shell/client/Applications/MarketingAutomation/packages/ma-core",
    "rxjs": "5.5.8",
    "zone.js": "0.8.25"
  },
  "devDependencies": {
    "@angular/compiler": "5.2.9",
    "@angular/compiler-cli": "5.2.9",
    "copyfiles": "2.0.0",
    "rimraf": "2.6.2",
    "ts-loader": "4.1.0",
    "typescript": "2.8.1",
    "webpack": "4.4.1",
    "webpack-cli": "^2.0.13"
  }
}

also change the module to es2015 to commonJs in tscinfig.aot.json

"compilerOptions": {
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "removeComments": true,
        "sourceMap": true,
        "outDir": "../codegen",
        "rootDir": "",
        "declaration": true,
        "lib": [
            "es2016",
            "dom"
        ]
    },
|improve this answer|||||
  • 1
    Thanks, it worked! That's a really weird one, I'd expect ma-core package to have references to Angular 5 too, but in 9.0.1 it still points to 4. – Alexander Doroshenko Apr 4 '18 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.