Forum Stats

  • 3,735,103 Users
  • 2,247,108 Discussions
  • 7,857,685 Comments

Discussions

v3.0.0 - Error with Grunt build and serve tasks with initConfig() in Gruntfile.js

Karen M
Karen M Member Posts: 32 Red Ribbon
edited May 2, 2017 3:34PM in Oracle JET

Hello,

I'm in the processing of upgrading to v3.0.0 following the instructions in the documentation.  My Gruntfile.js loads and registers other grunt tasks (in addition to the OracleJET's task) which require configurations defined in the initConfig.  If the grunt.initConfig({}) in the Gruntfile.js, JET's build and serve tasks encounter the following error and abort the task.

Task:       build

Error:      Running "build" task

               Running "oraclejet-build:undefined" (oraclejet-build) task
               Oracle JET Grunt plugin
               Processing Grunt command...
               JET Warning: Missing platform. Default to web.
              Warning: Cannot set property 'buildType' of undefined Use --force to continue.

               Aborted due to warnings.

Task:     serve

Error:     Running "serve" task

              Running "oraclejet-serve:undefined" (oraclejet-serve) task
              Oracle JET Grunt plugin
              Processing Grunt command...
              JET Warning: Missing platform. Default to web.
              Warning: Cannot read property 'connect' of undefined Use --force to continue.

              Aborted due to warnings.

I was able to reproduce the same error after scaffolding a new application from the Yeoman generator v3.0.0.  Added an empty grunt.initConfig({ }); between the require('load-grunt-config') and loadNpmTasks("grunt-oraclejet") in Gruntfile.js.  Performed grunt build and grunt serve; both tasks aborted with error.  Tried --force, it didn't work either.

Please let me know what need to be added to the initConfig so it both tasks would run successfully.

Thanks,

-karen

Answers

  • Venkhat-Oracle
    Venkhat-Oracle Member Posts: 3
    edited Apr 23, 2017 12:11PM

    Did the issue got resolved? If so, what is the solution ? Is there any work around  ?

  • Venkhat-Oracle
    Venkhat-Oracle Member Posts: 3
    edited May 2, 2017 5:49AM

    We had used sass config inside initConfig. Instead moved the sass files as part of custom theme and removed initConfig. Now it works though, but  could not find the solution to make grunt build to work with initConfig

  • John 'JB' Brock-Oracle
    John 'JB' Brock-Oracle Posts: 2,548 Employee
    edited May 2, 2017 10:56AM

    The answer to the grunt build situation is to build a temp project using the 3.0.0 generator-oraclejet cli

    yo oraclejet temproject --template=navdrawer

    and then copy the two JavaScript files from /scripts/grunt/config  over to the /scripts/grunt/config folder in your existing project.

    That will get things working properly.  This is a known issue and will be fixed in 3.1.0 which will be released in a few weeks.  Really sorry for the troubles.

    --jb

  • Venkhat-Oracle
    Venkhat-Oracle Member Posts: 3
    edited May 2, 2017 11:46AM

    Hi,

    I did try that. (Copying oraclejet-serve.js and oraclejet-build.js) Even after doing that, build did not work. If I comment out

    In my case, if I comment out grunt.initConfig section, build would work. I'm not sure, but based on my findings, grunt.initConfig({ }) is somehow causing the build to fail.

  • John 'JB' Brock-Oracle
    John 'JB' Brock-Oracle Posts: 2,548 Employee
    edited May 2, 2017 3:34PM

    Hi Venkhat,

    I recommend taking this to the internal mailing list and providing some more details on the environment that you are running from and the details of what you added to the initConfig section of the grunt file.

    Please do not provide information about any Oracle product configurations in this public forum.

    Thanks

Sign In or Register to comment.