javascriptbreezebrowserifygrunt-browserify

cannot find module breeze with browserify


I am attempting to load breeze using browserify. I used npm to install the breeze-client library. If I run browserify without including breeze everything runs fine, but when I include breeze I get the following error:

Error: Cannot find module 'breeze' from 'C:\...\node_modules\breeze-client'

I've tried doing the require every way I can think of

require("breeze-client");
require("breeze-client/breeze.debug");
require("breeze-client/breeze.debug.js");
require("../node_modules/breeze-client");
// etc...

Only thing I can think of now is that there is an issue with the module that's causing a problem with browserify.

Does anyone know of a change that can be made to the module to get this to work or is there some setting in browserify that I need to use?

Complete error message when trying to run browserify directly on the breeze module:

C:\...>browserify "node_modules/breeze-client" -o "scripts/dist/breeze.js"

Error: Cannot find module 'breeze' from 'C:\...\node_modules\breeze-client'
    at C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:46:17
    at process (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:173:43)
    at ondir (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:188:17)
    at load (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:69:43)
    at onex (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:92:31)
    at C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:22:47
    at FSReqWrap.oncomplete (fs.js:95:15)

Solution

  • need to make sure all references to require("breeze") were updated to require("breeze-client") inside the breeze.debug.js file as well as any adapters you might include from the build/adapters directory.

    There is a pull-request in to fix this so hopefully it won't be a problem in future versions.