I'm trying to run the csv-parse. And it fails with
Uncaught Error: Module name "stream" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded require.js:166
makeError require.js:166
localRequire require.js:1392
requirejs require.js:1737
(anonymous function) index.js?bust=1400069530273:58
The code in node_modules/csv-parse/lib/index.js
(not async!):
stream = require('stream');
I try to access the csvparse with this code:
define ['qunit'], () ->
csvparse = require(['csvparse'])
QUnit.test "csv namespace", () ->
QUnit.ok( csvparse?, "csvparse should exists: #{csvparse}" )
In my script for QUnit under Scripts
folder I do
requirejs.config({
baseUrl: '.',
paths: {
jquery: '../bower_components/jquery/dist/jquery',
qunit: '../bower_components/qunit/qunit/qunit',
csvparse: '../node_modules/csv-parse/lib/index',
util: '../node_modules/util/util',
stream: '../node_modules/stream/index'
},
});
My tree structure is
|--bower_components
| |--bootstrap
| |--jquery
| \--qunit
|--Content
|--node_modules
| |--bower
| |--csv-parse
| | |--lib
| | |--samples
| | |--src
| | \--test
| |--grunt
| |--grunt-contrib-coffee
| |--grunt-contrib-less
| |--grunt-contrib-qunit
| |--grunt-contrib-watch
| |--requirejs
| | \--bin
| |--stream
| | \--node_modules
| \--util
| |--node_modules
| |--support
| \--test
\--Scripts
So the problem as I see it is that the 'stream' module is not loaded. So how to make it work in the browser (Chromium 35)? Thanks!