About the Zendesk app scaffold

Have more questions? Submit a request

8 Comments

  • 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.


     

    1
  • 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.

    0
  • 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.


     


     

    0
  • 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)

    0
  • 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.


     

    0
  • Saranya

    Hi I am trying move an app from v1 to v2 using the scaffold. I am facing error like below when I run webpack --watch: 

    (node:17256) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
    (node:17256) DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly instead
    C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\lib\Chunk.js:846
    throw new Error(
    ^

    Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\lib\Chunk.js:846:9)
    at D:\Documents\Projects\Zendesk\EADS-49753\v2\UPS6\zendesk_app_migrator-master\src\app_scaffold\node_modules\extract-text-webpack-plugin\dist\index.js:176:48
    at Array.forEach (<anonymous>)
    at D:\Documents\Projects\Zendesk\EADS-49753\v2\UPS6\zendesk_app_migrator-master\src\app_scaffold\node_modules\extract-text-webpack-plugin\dist\index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.seal (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1242:27)
    at hooks.make.callAsync.err (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\lib\Compiler.js:546:17)
    at _done (eval at create (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:9:1)
    at _err1 (eval at create (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:32:10), <anonymous>:32:22)
    at _addModuleChain (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1093:12)
    at processModuleDependencies.err (C:\Users\ssathiskumar\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:1005:9)
    at process._tickCallback (internal/process/next_tick.js:61:11)

    The errors don't stop there. Even if I try to resolve this, I get another error like this :

    ERROR in multi babel-polyfill ./src/javascripts/index.js ./src/stylesheets/app.scss
    Module not found: Error: Can't resolve 'babel-loader' in 'D:\Documents\Projects\Zendesk\EADS-49753\v2\UPS4\zendesk_app_migrator-master\src\app_scaffold'
    @ multi babel-polyfill ./src/javascripts/index.js ./src/stylesheets/app.scss app[1]

     

    Can someone help me out. Thanks in advance.

    0
  • zumartic

    @Saranya does this help?

    https://github.com/webpack/webpack/issues/6568

    -Zumartic-

    0
  • Charles Nadeau

    Update: This article has been revised to point to the readme for the app scaffold on Github:

    https://github.com/zendesk/app_scaffold/blob/master/README.md

    The readme is the source of truth for the Zendesk app scaffold.

    The scaffold uses several third-party technologies (see the readme). For help on using them, see the documentation provided by the developers of these technologies.

    0

Please sign in to leave a comment.

Powered by Zendesk