Skip to content

Wrong lookup path #196

Description

@pointlessone

Hello,

I'm experience an issue in an app I didn't develop but I want to deploy.

My setup is Rails 5 app with broowserify-rails 4.1.0. I'm deploying the app with Capistrano.

It's a typical capistrano layout:

  • /var/www/app
    • releases
      • 123
        • node_modules -> /var/www/app/shared/node_modules
        • public
          • assets -> /var/www/app/shared/public/assets
    • shared
      • node_modules
      • public
        • assets

I'm getting an error like this:

BrowserifyRails::BrowserifyError: Error while running `/var/www/app/releases/123/node_modules/.bin/browserify --transform babelify --extension=".jsx" --list -o "/var/www/app/releases/123/tmp/cache/browserify-rails/output20170424-28084-u5l9bm" -`:

events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find module '../../../../../shared/node_modules/is-buffer/index.js' from '/var/www/app/shared/node_modules/http-link-header/lib'
    at /var/www/appshared/node_modules/resolve/lib/async.js:55:21
    at load (/var/www/app/shared/node_modules/resolve/lib/async.js:69:43)
    at onex (/var/www/app/shared/node_modules/resolve/lib/async.js:92:31)
    at /var/www/app/shared/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:114:15)
Ruby backtrace
/var/www/app/shared/bundle/ruby/2.4.0/gems/browserify-rails-4.1.0/lib/browserify-rails/browserify_processor.rb:221:in `run_browserify'
/var/www/app/shared/bundle/ruby/2.4.0/gems/browserify-rails-4.1.0/lib/browserify-rails/browserify_processor.rb:144:in `dependencies'
/var/www/app/shared/bundle/ruby/2.4.0/gems/browserify-rails-4.1.0/lib/browserify-rails/browserify_processor.rb:121:in `commonjs_module?'
/var/www/app/shared/bundle/ruby/2.4.0/gems/browserify-rails-4.1.0/lib/browserify-rails/browserify_processor.rb:93:in `should_browserify?'
/var/www/app/shared/bundle/ruby/2.4.0/gems/browserify-rails-4.1.0/lib/browserify-rails/browserify_processor.rb:35:in `call'
/var/www/app/shared/bundle/ruby/2.4.0/gems/browserify-rails-4.1.0/lib/browserify-rails/browserify_processor.rb:16:in `call'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:23:in `block in call'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/utils.rb:200:in `dfs'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/bundle.rb:24:in `call'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:75:in `call_processor'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/processor_utils.rb:56:in `call_processors'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:60:in `block in load'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/loader.rb:44:in `load'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/cached_environment.rb:47:in `load'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:66:in `find_asset'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:142:in `block in find'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `each'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:209:in `stat_directory'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/path_utils.rb:227:in `stat_tree'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `each'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `each'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/legacy.rb:104:in `logical_paths'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:140:in `find'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/sprockets/manifest.rb:185:in `compile'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-3.7.1/lib/rake/sprocketstask.rb:147:in `with_logger'
/var/www/app/shared/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/var/www/app/shared/bundle/ruby/2.4.0/gems/rake-12.0.0/exe/rake:27:in `'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `load'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/cli/exec.rb:27:in `run'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/cli.rb:335:in `exec'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/cli.rb:20:in `dispatch'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/cli.rb:11:in `start'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/exe/bundle:32:in `block in '
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/home/deployer/.rvm/gems/ruby-2.4.1@app/gems/bundler-1.14.6/exe/bundle:24:in `'
/home/deployer/.rvm/gems/ruby-2.4.1@app/bin/bundle:22:in `load'
/home/deployer/.rvm/gems/ruby-2.4.1@app/bin/bundle:22:in `'
/home/deployer/.rvm/gems/ruby-2.4.1@app/bin/ruby_executable_hooks:15:in `eval'
/home/deployer/.rvm/gems/ruby-2.4.1@app/bin/ruby_executable_hooks:15:in `'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

If you take a closer look at the module path it tries to find there seem to be one extra ... Without it I can find the file on disk.

I searched on the web and can't find anything like this. I myself have no experience with either browserify. Please advice how to fix this issue. Please let me know if you need any additional information.

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