Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot read property 'fromJS' of undefined

User_IPNT8Feb 23 2017 — edited Feb 24 2017

Hi All,

I have been battling with this issue for a while and cannot figure out why this is not working. It is erroring out on this:

                        self.userProfileModel(ko.mapping.fromJS(result));

This line is in my login.js and in my login.js file I do have the define for mapping there:

define(['ojs/ojcore', 'knockout', 'jquery', 'dataservice', 'mapping', 'ojs/ojknockout', 'ojs/ojmodel', 'ojs/ojbutton', 'ojs/ojinputtext',  'ojs/ojmodule', 'ojs/ojknockout-validation', 'ojs/ojrouter', 'ojs/ojmoduleanimations'],

        function (oj, ko, $, data, mapping) {

.....

}

In my main.js I also have it listed:

requirejs.config({

  // Path mappings for the logical module names

  paths:

  //injector:mainReleasePaths

  {

    'knockout': 'libs/knockout/knockout-3.4.0',

    'mapping': 'libs/knockout/knockout.mapping-latest',

    'jquery': 'libs/jquery/jquery-3.1.0.min',

    'jqueryui-amd': 'libs/jquery/jqueryui-amd-1.12.0.min',

    'promise': 'libs/es6-promise/es6-promise.min',

    'hammerjs': 'libs/hammer/hammer-2.0.8.min',

    'ojdnd': 'libs/dnd-polyfill/dnd-polyfill-1.0.0.min',

    'ojs': 'libs/oj/v2.3.0/debug',

    'ojL10n': 'libs/oj/v2.3.0/ojL10n',

    'ojtranslations': 'libs/oj/v2.3.0/resources',

    'signals': 'libs/js-signals/signals.min',

    'text': 'libs/require/text',

    'oraclemapviewer': 'libs/oraclemapsv2',

    'oracleelocation': 'libs/oracleelocationv3'

  }

What am I missing here? I have tried to google this and most people just forgot to include the knockout.mapping-latest.js file but I have it there in the correct location?

This post has been answered by John JB Brock-Oracle on Feb 23 2017
Jump to Answer
Comments
Post Details
Added on Feb 23 2017
5 comments
1,545 views