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

Gobble grab EEXIST symlink error #89

Open
bathos opened this issue Sep 28, 2015 · 5 comments
Open

Gobble grab EEXIST symlink error #89

bathos opened this issue Sep 28, 2015 · 5 comments
Labels

Comments

@bathos
Copy link

bathos commented Sep 28, 2015

I'm not sure if this is actually a Gobble issue, but it's my best guess at the moment. I have a gobblefile that runs fine locally (on Windows). I'm deploying to Heroku, and the same gobblefile exits with an error midway through:

gobble: build started
gobble: 09-moveTo done in 8ms
gobble: 01-babel done in 372ms
∙∙∙∙∙∙∙ 10-grab running...
gobble: 10-grab transformation failed

input:  /app/.gobble-build/01-babel/1
output: /app/.gobble-build/10-grab/1
>>>
EEXIST, symlink '/app/.gobble-build/10-grab/1'
Error: EEXIST, symlink '/app/.gobble-build/10-grab/1'
    at Error (native)
<<<

It strikes me as ... wrong. If I look at the .gobble-build directory on heroku, there is an empty /10-grab/1 directory. On my local machine, that step goes fine and the 10-grab/1 directory contains a js file.

Might this be a gobble issue, or is it more likely to be caused by something else?

EDIT:

If I remove the grab step, things work fine. It looks like this could be coming from sander's symlinkOrCopy method, which has different behavior for windows.

@timshannon
Copy link

Yeah I'm running into the same issue. I can't seem to use .grab like the documentation says:

Grab all the files in the specified subdirectory. For example, if src/assets were a directory with an images subdirectory, you could do this:

assets = gobble( 'src/assets' );
images = assets.grab( 'images' );
images would now contain the contents of src/assets/images.

At least not on Linux.

@fskreuz
Copy link

fskreuz commented Mar 20, 2016

I can confirm that this is a grab issue (at least on the Gobble side of things) and still present on gobble@0.10.2.

For anyone who comes across this, a quick fix is to just build a custom transform that uses some other module to copy over contents from target input dir to the output dir.

@IvanSanchez
Copy link
Member

This is still an issue.

I'll try setting up a unit test for this and have a look.

@teehemkay
Copy link

teehemkay commented Jul 6, 2016

FWIW and as far as I can tell by reading the source code, the problem seems to be that gobble first creates the output directory and then tries to sander.symlinkOrCopy() using this just created directory as the target. Which results in an error since the directory already exists.

I'm just guessing but it seems to me that the tricky thing is that gobble always creates the outputdir (in Node.ready()) before running the transform.
But in the case of the grabtransform, the transform itself tries to create the outputdir. And this results in an error since the directory already exists.

@IvanSanchez , there's now a test case for this added by @TrySound but it's currently disabled.

@fskreuz
Copy link

fskreuz commented Jan 28, 2017

Still experiencing the same issues with grab on macOS and Linux. Not happening in Windows tho.

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

No branches or pull requests

5 participants