Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error finding module #12

Open
joshwils82 opened this issue May 17, 2016 · 1 comment
Open

Error finding module #12

joshwils82 opened this issue May 17, 2016 · 1 comment

Comments

@joshwils82
Copy link

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!

@joshwils82
Copy link
Author

One other thought, would it be possible to add the inputDirectory to the options.paths when running browserify? That was I could just use require('components/login') to resolve the ractive module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant