Skip to content

Error finding module #12

@joshwils82

Description

@joshwils82

I am attempting to use this with gobble-ractive and am running into problems finding the ractive component that was previously transformed into js.

My project structure looks like this:

src/scripts/component/login.html
src/scripts/routing.js

routing.js includes the following require:

require('./components/login')

by gobblefile contains:

gobble('src/scripts')
        .transform('ractive', {type: 'cjs'})
        .transform('browserify', {
            entries: './routing.js',
            dest: 'bundle.js'
        })

package.json

  "devDependencies": {
    "gobble": "^0.11.3",
    "gobble-browserify": "^13.0.0",
    "gobble-less": "^0.3.0",
    "gobble-ractive": "^0.2.0"
  }

The error I am receiving is

Cannot find module './components/login' from '/home/jwilson/Development/myproject/src/scripts'

It appears it is trying to resolve the login module from the original source directory instead of the gobble build cache.

From what I can tell, it appears this is due to the fact the gobble is using symlinks in the .gobble-build folder and when routing.js is resolved, browserify resolves it to the real path instead of the .gobble-build directory. This then causes the the require of the login component to fail.

It appears there is an issue with this component since browserify is actually resolving the gobble symlinks to real paths with is breaking the relative requires that have previously been transform (ractive components).

Does this sound right? Any possible work arounds to this problem. Thanks!

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