Under "Required module not found" at http://flowtype.org/docs/troubleshooting.html you'll see some tips for working with node modules. Flow seems to understand some modules but not others (for example, it works with react but not jiff).
would be nice if it could read the require.js config file automatically. Would be more DRY
Working with requirejs would take more than configuring paths - it means understanding AMD.
FWIW, we use requirejs on our project but we've been burned enough times by using the less popular format that I'm considering switching to commonjs anyway.
@rileylark I've tried commonjs on my project but there are some major issues for me:
Can't live with those 2 issues... But you are right, is easier to use browserify.
FWIW, we use requirejs on our project but we've been burned enough times by using the less popular format that I'm considering switching to commonjs anyway.
I'd take a look at ES6 modules if you don't mind compiling your code. https://github.com/systemjs/systemjs will allow you to use ES6, AMD, CJS and globals.
@briandipalma Sincerely, this seems amazing. (you say "will", is not yet done?) The only issue now is the build process. Anyone knows how to fix that problem?
You make change A, build starts, make change B, build ends, you only have change A; You have to make another change to include the change B in your built file.
@totty90 Sorry, does. Not will.
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.
we support commonjs and ES6 these days, and should detect file changes properly. i think this is fixed, but let me know if there's still something missing here.
It is possible to write flowed code using require.js, you need to fool flow into thinking the code is commonjs, but this is possible in principle using the comment syntax. For example:
/*@flow*/
/*::const define = () => {};*/
define([
'/common/common.js',
'/bower_components/jquery/dist/jquery.min.js'
], /*::0);module.exports = (*/ function (Common) {
/*::Common = require('./common/common.js');*/
Common.doStuff();
///...code goes here
})/*::()*/;
It's a bit annoying that we are forced to use require syntax twice but this is the price to pay for flow and requirejs I guess.
@cjdelisle Any idea how to deal with that problem:

Method cannot be called on possibly undefined value undefined
Oh I changed to a different method recently.
/*@flow*/
/*::
const define = () => {};
export type MyType_t = {
id: number,
...
};
*/
define([
'/common/common.js',
'jquery',
'/common/hyperscript.js',
'/common/Html.js',
'/common/Ver.js'
], function (Common, $, h, Html, Ver) { /*::});module.exports = (function() {
const Common = require('./common/common.js');
const h = require('./common/hyperscript.js');
const $ = (undefined:any);
const Html = require('./common/Html.js');
const Ver = require('./common/Ver.js');
*/
var Messages = Common.Messages;
... code goes here ....
})/*::()*/;
This method seems to work well.
Most helpful comment
Oh I changed to a different method recently.
This method seems to work well.