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

Torba::Errors::NothingToImport: {:package=>"angular", :path=>"lib/angular.js"} on Heroku deploys #22

Open
bhgames opened this issue Feb 6, 2016 · 6 comments

Comments

@bhgames
Copy link

bhgames commented Feb 6, 2016

Hey, just an FYI, when I deployed to my staging server a slightly altered path definition for my angular package, I got this error:

Torba::Errors::NothingToImport: {:package=>"angular", :path=>"lib/angular.js"} 

I think it was because my cache had cached a whitelisted set of files from the NPM that didn't include my new path. The fix for this was:

heroku plugins:install https://github.com/heroku/heroku-repo.git

heroku repo:purge_cache -a my-staging-app

The normal assets:clobber call didn't work, so I used heroku-repo's purge_cache ability to do it. This shouldn't happen too often, as normally you're adding rows to the Torba file, not changing the directories you're whitelisting.

@nashbridges
Copy link
Member

Hmm, that's odd.
The cache is not affected by import option, it is 1-to-1 mirror of a remote archive.
Could you provide steps to reproduce this on example application?

@bhgames
Copy link
Author

bhgames commented Feb 7, 2016

I'm not exactly sure how to reproduce it, as it was the result of a lot of experimentation.

I think my original Torbafile had:

npm "angular", package: "angular", version: "1.2.23"

but then it was changed to:

npm "angular", package: "angular", version: "1.2.23", import: %w[
  lib/angular.js
]

Since it places lib/angular.js at the top level (angular-1231231/angular/angular.js) and the original version imports everything, so it'd be at angular-123123/angular/lib/angular.js in the original, that since it cached the original version and didn't update it when I changed it to have a specific import statement, it was looking for a nonexistent file in that folder.

And I've checked both versions of the folder in my local .torba folder:

MacBook-Air:boardvitals arkavon$ ls ~/.torba/angular-2ffa60d4/angular/
angular.js
MacBook-Air:boardvitals arkavon$ ls ~/.torba/angular-efa92258/
angular
MacBook-Air:boardvitals arkavon$ ls ~/.torba/angular-efa92258/angular/
LICENSE bin full.js index.js min.js test
README.md custom.js index-browserify.js lib package.json

As you can see, the cache on my local is not a 1 to 1 mirror of the remote archive, it is specifically whatever I import.

@nashbridges
Copy link
Member

We're talking about different caches now.

The NothingToImport error you've reported is raised when you try to :import something that is not present in ~/.torba/cache/<package> (per default installation). This folder contains all files from a remote archive. That's why it is odd that lib/angular.js wasn't found there, because it should.

@bhgames
Copy link
Author

bhgames commented Feb 7, 2016

Oh, I see. I have absolutely no idea then why it wouldn't find it. It's our staging server, I was pushing to it a lot when experimenting with Torba, and simultaneously when I wasn't using it, others were pushing branches that did not have Torba on it again. Maybe it had something to do with that. We did not have the same issue pushing to production.

@nashbridges
Copy link
Member

Let's leave it open for a while. Maybe someone will figure out how to reproduce this.

@bhgames
Copy link
Author

bhgames commented Feb 7, 2016

Yeah, and they have a solution that will show up in Google if they have same issue.

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

2 participants