Skip to content

Require fails at runtime with "Cannot find module ..' #6

@ammojamo

Description

@ammojamo

I have a basic sample project here:
https://github.com/ammojamo/gobble-browserify-require-broken

The project builds fine, but gobble-browserify generates a bundle where some (but not all) of the paths have been changed to start with '@' (seems to be some magic in cacheDependency). When you attempt to run the javascript in a browser (e.g. open the built index.html), it fails with the error:

Uncaught Error: Cannot find module '@/dependency.js'

Maybe related: the output also contains absolute paths (/Users/myname/etc...) and this is impossible to override in the options because gobble-browserify has options.fullPaths=true hard coded.

P.S. I have tried many build tools in many different languages and Gobble is easily my favourite. Well done! I just love the simplicity of it and confidence with which I can write custom transformations if I need to.

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