Skip to content

Mystifying gobble error on browserify #87

Open
@martypdx

Description

@martypdx

We replicated our working gobble build to a new project and hit a roadblock.

Essentially, there are js files getting merged and then browserified via:

var bundle = gobble( [ components, js, vendor ] )
    .transform( 'browserify', {
        entries: './index.js',
        configure: function ( bundle ) {
            excludeModules.forEach( function( module ) {
                bundle.exclude( module );
            });
        },
        dest: 'bundle.js',
        debug: gobble.env() !== 'production'
    });

I can see in the .gobble dir that the merge happens successfully, but then it fails in the browserify step with:

∙∙∙∙∙∙∙ 18-browserify running...                                                                                                        
gobble: 18-browserify transformation failed

input:  /Users/marty/ractive-starter-project/.gobble/17-merge/1
output: /Users/marty/ractive-starter-project/.gobble/18-browserify/1
>>>
Cannot find module './app' from '/Users/marty/ractive-starter-project/.gobble/05-babel/.cache'
Error: Cannot find module './app' from '/Users/marty/ractive-starter-project/.gobble/05-babel/.cache'
    at /Users/marty/ractive-starter-project/node_modules/gobble-browserify/node_modules/browserify/node_modules/resolve/lib/async.js:55:21
    at load (/Users/marty/ractive-starter-project/node_modules/gobble-browserify/node_modules/browserify/node_modules/resolve/lib/async.js:69:43)
    at onex (/Users/marty/ractive-starter-project/node_modules/gobble-browserify/node_modules/browserify/node_modules/resolve/lib/async.js:92:31)
    at /Users/marty/ractive-starter-project/node_modules/gobble-browserify/node_modules/browserify/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:95:15)
<<<

which is odd because it is looking in .gobble/05-babel/.cache folder which that is the pre-merge location of index.js, not the one in 17-merge/1. So it finds dependencies prior to the merge, but not those after the merge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions