0
votes

Already seen many topics here but none of the pointed solutions worked.

When optimizing my project, R.js is failing to handle this json! plugin dependency on one of my modules.

Error message:

Tracing dependencies for: app/productApp
TypeError: errback is not a function
In module tree:
    app/productApp
      blah
        json

My r.js build config file:

define([
    'productApp',
    'json!blah'
], function(...){...}

and here is my r.js config file:

({
      name: 'app/productApp',
      out: '../app.js',
      optimize: 'uglify2',
      findNestedDependencies: true,
      inlineJSON: false,
      inlineText: false,
      exclude: [ 'json!blah' ]
)}

I've already tried all possible ways, such as an exclude on the r.js config file, or and adding '!bust' at the end of the dependency list, but no luck.

Require.js / R.js version: 2.2.0

One detail: I'm running r.js through node package.json script, triggered by maven.

Thoughts?

1

1 Answers

0
votes

Found the solution. It turns out that the paths to the json and text libraries were missing from require config file. (it can't be just made 'empty:' within r.js build config file).

This then would fix the issue:

... 
paths: {
  'text': 'lib/text',
  'json': 'lib/json',
  ...
},
exclude: {
  'json!blah'
}