Getting started with the Zendesk app scaffold Follow

Comments

11 comments

  • Avatar
    Austin Villanueva

    Hi guys, 


    I need help. I'm pretty new with zat tool. I'm using this process in the article. 


    The zat create command works fine but why does it fail in zat validate? 


    I tried the other one in other article which uses , zat new then some prompts then afterwards. I tried the zat validate .and it works fine with that process. 


    both use the same zat. but why using this scaffold doesn't work with zat validate? 


    I hope you can help me.


    Thank you


     


    Austin

  • Avatar
    Joseph May

    Hi there Austin-


    May I ask you to share the stack trace printed when zat validate fails? Normally zat validate would be run in the /dist directory, though you could also run it in the parent directory provided you explicitly set the path:


    zat validate --path=./dist

    Hope this helps!

  • Avatar
    Austin Villanueva

    Hi Joseph,


    Yeah, this one works, I just saw it in Github documentation I didn't saw it before. I've been struggling for a long time with this one. 


    Thanks!

  • Avatar
    Kiran Madhav

    Hi there,


    I'm in the process of migrating v1 apps to v2 by using App Scaffold template, how can I can call 'client' in the legacy_app.js. 


    My requirement is, I need to call ticket custom field values in the in legacy_app.js file or pass values to legacy_app.js file from index.js.


    Please suggest how can I achieve this.


    Thanks,


    Kiran.


     

  • Avatar
    Hector Latorre

    Having the same problem as Kiran, trying to get a reference to the client object from legacy_app.


     


    Edit: 


    @Kiran this.zafClient references client from legacy_app, found it in one of the example apps from the zendesk_app_migrator repo.

  • Avatar
    Alex Pereira

    Guys, I am having an issue with the command:


     webpack --watch

    Does anyone have any ideas?


    C:\_git\internal\Zendesk\AgentsTicketApp\v2\dist>webpack --watch
    C:\_git\internal\Zendesk\AgentsTicketApp\v2\node_modules\webpack-cli\bin\webpack.js:289
    const statsPresetToOptions = require("webpack").Stats.presetToOptions;
    ^

    TypeError: Cannot read property 'presetToOptions' of undefined
    at processOptions (C:\_git\internal\Zendesk\AgentsTicketApp\v2\node_modules\webpack-cli\bin\webpack.js:289:57)
    at yargs.parse (C:\_git\internal\Zendesk\AgentsTicketApp\v2\node_modules\webpack-cli\bin\webpack.js:510:3)
    at Object.parse (C:\_git\internal\Zendesk\AgentsTicketApp\v2\node_modules\webpack-cli\node_modules\yargs\yargs.js:543:18)
    at C:\_git\internal\Zendesk\AgentsTicketApp\v2\node_modules\webpack-cli\bin\webpack.js:217:8
    at Object.<anonymous> (C:\_git\internal\Zendesk\AgentsTicketApp\v2\node_modules\webpack-cli\bin\webpack.js:512:3)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at C:\Users\<user>\AppData\Roaming\npm\node_modules\webpack-cli\bin\webpack.js:15:3
    at Object.<anonymous> (C:\Users\<user>\AppData\Roaming\npm\node_modules\webpack-cli\bin\webpack.js:512:3)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Module.require (module.js:593:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\<user>\AppData\Roaming\npm\node_modules\webpack\bin\webpack.js:12:2)
    at Module._compile (module.js:649:30)
    at Object.Module._extensions..js (module.js:660:10)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:501:12)
    at Function.Module._load (module.js:493:3)
    at Function.Module.runMain (module.js:690:10)
    at startup (bootstrap_node.js:194:16)
    at bootstrap_node.js:666:3

     


     


     


    Environment:


    Windows 10 64bit


    C:\_git\internal\Zendesk\AgentsTicketApp\v2>node -v
    v9.9.0

    C:\_git\internal\Zendesk\AgentsTicketApp\v2>webpack -v
    4.2.0

    C:\_git\internal\Zendesk\AgentsTicketApp\v2>webpack-cli -v
    2.0.12

    C:\_git\internal\Zendesk\AgentsTicketApp\v2>npm -v
    5.6.0

    C:\_git\internal\Zendesk\AgentsTicketApp\v2>foreman -v
    0.84.0

     


    UPDATE:


    Solved


    I uninstalled webpack-cli both local and global, and reinstalled it global only. It seems to have worked.


     


     

  • Avatar
    Joseph May

    Hi Alex-


    Looks like you are in the wrong directory. Can you cd into the /dist directory and try again?

  • Avatar
    Alex Pereira

    Hi Joseph,


    I updated the original post. It seems to be solved now.


    Thanks!


     

  • Avatar
    Joseph May

    Great to hear, Alex!

  • Avatar
    zumartic

    Hi,


    I have migrated my v1 application to v2 and I am using scaffold boilerplate. Application runs perfectly when running in the local environment. I tried to start Karma in order to build unit tests and I got the following error message. 


    PhantomJS 2.1.1 (Windows 8.0.0) LegacyApp #renderMain switches to the main template FAILED
    TypeError: undefined is not an object (evaluating 'this._metadata.settings[name]') in spec/src/legacy_app_spec.js (line 557)
    setting@spec/src/legacy_app_spec.js:557:35
    doInit@spec/src/legacy_app_spec.js:2759:39
    doInit@[native code]
    BaseApp@spec/src/legacy_app_spec.js:457:40
    App@spec/src/legacy_app_spec.js:577:17
    spec/src/legacy_app_spec.js:2237:35
    Error: <spyOn> : could not find an object to spy upon for switchTo()
    Usage: spyOn(<object>, <methodName>) in node_modules/jasmine-core/lib/jasmine-core/jasmine.js (line 4927)
    spec/src/legacy_app_spec.js:2242:12
    TypeError: undefined is not an object (evaluating 'app.renderMain') in spec/src/legacy_app_spec.js (line 2247)
    spec/src/legacy_app_spec.js:2247:10
    PhantomJS 2.1.1 (Windows 8.0.0): Executed 5 of 5 (1 FAILED) (0.019 secs / 0 secs)

  • Avatar
    Joseph May

    Hi Zumartic-


    Thanks for writing in. The issue here is relative to your OS rather than our app scaffold - I would recommend upgrading to Windows 10 (and taking advantage of the Windows Subsystem for Linux). When searching the first error in the stacktrace there, I found the following:


    Error running tests using Karma


    Use community QtWebKit >= 5.9


    I suggest following the latter link (the former is closed, anyway) to keep up with notifications regarding QtWebKit. You could try to strictly target ES5 as PhantomJS doesn't support ES6 yet until the QtWebKit fix is implemented.


     

Please sign in to leave a comment.

Powered by Zendesk