torba
torba copied to clipboard
Torba::Errors::NothingToImport: {:package=>"angular", :path=>"lib/angular.js"} on Heroku deploys
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.
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?
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.
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.
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.
Let's leave it open for a while. Maybe someone will figure out how to reproduce this.
Yeah, and they have a solution that will show up in Google if they have same issue.