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

Source and destination must not be the same #23588

Closed
rnnyrk opened this issue Apr 29, 2020 · 3 comments
Closed

Source and destination must not be the same #23588

rnnyrk opened this issue Apr 29, 2020 · 3 comments
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@rnnyrk
Copy link

rnnyrk commented Apr 29, 2020

Description

I'm trying to run my project, but whatever I try I keep getting to error "Source and destination must not be the same". Because there is no clear destination of the error either, I'm not able to find the issue and solve it.

Steps to reproduce

  1. Clone https://github.com/rnnyrk/gatsby-boilerplate-ts
  2. Run npm install
  3. Run npm run start
  4. Error will pop up

I've tried to disable as many plugins as possible in my gatsby-config.js, but still can't run the project.

Expected result

Project should run without errors

Actual result

Project should run with error "Source and destination must not be the same"

Environment

System:
    OS: macOS 10.15.4
    CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    Yarn: 1.10.1 - /usr/local/bin/yarn
    npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 81.0.4044.129
    Firefox: 75.0
    Safari: 13.1
  npmPackages:
    gatsby: 2.21.1 => 2.21.1
    gatsby-image: 2.4.0 => 2.4.0
    gatsby-plugin-create-client-paths: 2.3.0 => 2.3.0
    gatsby-plugin-manifest: 2.4.1 => 2.4.1
    gatsby-plugin-module-resolver: 1.0.3 => 1.0.3
    gatsby-plugin-offline: 3.2.0 => 3.2.0
    gatsby-plugin-react-helmet: 3.3.0 => 3.3.0
    gatsby-plugin-react-svg: ^2.1.2 => 2.1.2
    gatsby-plugin-sharp: 2.6.0 => 2.6.0
    gatsby-plugin-styled-components: 3.3.0 => 3.3.0
    gatsby-plugin-typescript: 2.4.0 => 2.4.0
    gatsby-source-filesystem: 2.3.0 => 2.3.0
    gatsby-transformer-sharp: 2.5.0 => 2.5.0
  npmGlobalPackages:
    gatsby-cli: 2.8.15
@rnnyrk rnnyrk added the type: bug An issue or pull request relating to a bug in Gatsby label Apr 29, 2020
@vladar
Copy link
Contributor

vladar commented Apr 29, 2020

Hi @rnnyrk

Sorry to hear you're running into an issue. But I could not reproduce it with the steps above. I had to re-enable some plugins to make it work but I don't see this error.

The error itself sounds like an fs-extra error that occurs when trying to copy a file or folder to itself. Maybe you have some symlinks or other FS-related environment that makes it happen?

@rnnyrk
Copy link
Author

rnnyrk commented Apr 29, 2020

@vladar Thanks for your reply. I have no clue what's going on. Tried it just now on another laptop and here it's working fine as well. Actually no clue what's going on on the other setup tho..

@Ash-Matter
Copy link

Hi,
I'm experiencing this during a gatsby develop session but not as part of the initial start up, rather after a page refresh that contains an image that is created and stored in the public folder.
In my case, the image is created as part of the gatsby-source-wordpress plugin, which uses this plugin, and it appears that on second attempt to load the page, the system doesn't check to see if the file already exists and throws this error.

Steps to replicate:

  1. Have an external image stored as a file node
  2. Reference the publicUrl to the file on a page
  3. Start gatsby develop
  4. Navigate to page (which will work - note that /public/_gatsby/file/#HASH#/#FILENAME# is generated at this point)
  5. Refresh page and error occurs, killing the development session

The error in the console is:
image

Based on this alone, it feels like a check is required for whether the file already exists or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants