Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1 View

If using require.js, Simulate mode will not work

Jump to solution

We use require.js to manage javascript code modules, and we are no longer able to use the XDK in Simulate mode.  The simulate feature uses a javascript file called app-host.js which implements its own 'require' object that lives in the global namespace.  As a result, any calls to require.js will fail. 

Tags (2)
0 Kudos

Accepted Solutions
Highlighted
1 View

Hi,

Thanks for reporting this. We are working on releasing a hotfix soon that includes the fix for this issue. But in the meantime, as a workaround you can do the following in your current installation of Intel XDK to patch it and continue working:

1 - Make sure that the XDK is closed, and open the file components/server/simulator/cordova-simulate/src/server/sim-files.js in an editor. According to your operating system, you can find that file in the following path:

  • MAC: /Applications/Intel XDK.app/Contents/Resources/app.nw/
  • Windows: C:\Users\<your-user>\AppData\Local\Intel\XDK\xdk\
  • Linux:
    • Installed as root: /opt/intel/XDK/xdk/
    • Installed as user: ~/intel/XDK/xdk/

2 - Replace the line 142, that looks like this,

var b = browserify({ paths: getBrowserifySearchPaths(hostType), debug: false });

with the following snippet:

var b = browserify({
    paths: getBrowserifySearchPaths(hostType),
    debug: false,
    exports: false, // needed to prevent browserify to override hasExports option by set it to true
    hasExports: false
});

3 - Save the changes, and start the XDK.

This should fix the issue. Please, let us know if you have any trouble on patching it, and if it works for you.

Thanks.

 

 

View solution in original post

0 Kudos
3 Replies
Highlighted
Employee
1 View

Thanks for the feedback, I'll

Jump to solution

Thanks for the feedback, I'll let the appropriate engineer know.

0 Kudos
Highlighted
2 Views

Hi,

Thanks for reporting this. We are working on releasing a hotfix soon that includes the fix for this issue. But in the meantime, as a workaround you can do the following in your current installation of Intel XDK to patch it and continue working:

1 - Make sure that the XDK is closed, and open the file components/server/simulator/cordova-simulate/src/server/sim-files.js in an editor. According to your operating system, you can find that file in the following path:

  • MAC: /Applications/Intel XDK.app/Contents/Resources/app.nw/
  • Windows: C:\Users\<your-user>\AppData\Local\Intel\XDK\xdk\
  • Linux:
    • Installed as root: /opt/intel/XDK/xdk/
    • Installed as user: ~/intel/XDK/xdk/

2 - Replace the line 142, that looks like this,

var b = browserify({ paths: getBrowserifySearchPaths(hostType), debug: false });

with the following snippet:

var b = browserify({
    paths: getBrowserifySearchPaths(hostType),
    debug: false,
    exports: false, // needed to prevent browserify to override hasExports option by set it to true
    hasExports: false
});

3 - Save the changes, and start the XDK.

This should fix the issue. Please, let us know if you have any trouble on patching it, and if it works for you.

Thanks.

 

 

View solution in original post

0 Kudos
Highlighted
Beginner
1 View

Confirmed.  This patch worked

Jump to solution

Confirmed.  This patch worked perfectly.  Many thanks.

0 Kudos