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

Symlink in /static fails build #24865

Closed
azhang opened this issue Jun 8, 2020 · 4 comments
Closed

Symlink in /static fails build #24865

azhang opened this issue Jun 8, 2020 · 4 comments
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@azhang
Copy link

azhang commented Jun 8, 2020

Description

A javascript library I'm using needs to be available as static files, and is also required in the code. Hence, I put it in src/components/Something/charting_library and symlinked it to static.
This symlink gets served properly in development mode, but cannot be built.

Steps to reproduce

ln -s src/components/Something/charting_library static/
yarn build

Expected result

no errors

Actual result

ERROR 

ENOENT: no such file or directory, stat '/Users/allie/src/blep/website/static/charting_library'



 Error: ENOENT: no such file or directory, stat '/Users/allie/src/blep/website/static/charting_library'
 
 - polyfills.js:307 Object.statSync
   [website]/[graceful-fs]/polyfills.js:307:34
 
 - stat.js:58 getStatsSync
   [website]/[fs-extra]/lib/util/stat.js:58:18
 
 - stat.js:90 Object.checkPathsSync
   [website]/[fs-extra]/lib/util/stat.js:90:33
 
 - copy-sync.js:119 copyDirItem
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:119:29
 
 - copy-sync.js:113 
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:113:39
 
 - Array.forEach
 
 - copy-sync.js:113 copyDir
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:113:23
 
 - copy-sync.js:103 onDir
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:103:10
 
 - copy-sync.js:45 getStats
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:45:37
 
 - copy-sync.js:38 startCopy
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:38:10
 
 - copy-sync.js:33 handleFilterAndCopy
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:33:10
 
 - copy-sync.js:26 Object.copySync
   [website]/[fs-extra]/lib/copy-sync/copy-sync.js:26:10
 
 - get-static-dir.js:38 
   [website]/[gatsby]/dist/utils/get-static-dir.js:38:35
 
 - Array.map
 
 - get-static-dir.js:38 copyStaticDirs
   [website]/[gatsby]/dist/utils/get-static-dir.js:38:4
 

not finished run queries - 0.053s
error Command failed with exit code 1.

Environment

System:
  OS: macOS 10.15.4
  CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
  Shell: 5.7.1 - /bin/zsh
Binaries:
  Node: 12.2.0 - ~/.nvm/versions/node/v12.2.0/bin/node
  Yarn: 1.22.4 - /usr/local/bin/yarn
  npm: 6.9.0 - ~/.nvm/versions/node/v12.2.0/bin/npm
Languages:
  Python: 2.7.16 - /usr/bin/python
Browsers:
  Chrome: 83.0.4103.61
  Firefox: 66.0.3
  Safari: 13.1
npmPackages:
  gatsby: ^2.15.15 => 2.20.14
  gatsby-paginate: ^1.1.1 => 1.1.1
  gatsby-plugin-feed: ^2.3.12 => 2.4.1
  gatsby-plugin-google-tagmanager: ^2.1.9 => 2.2.1
  gatsby-plugin-manifest: ^2.2.16 => 2.3.3
  gatsby-plugin-netlify-cms: ^4.1.15 => 4.2.2
  gatsby-plugin-nprogress: ^2.1.6 => 2.2.1
  gatsby-plugin-offline: ^3.0.6 => 3.1.2
  gatsby-plugin-postcss: ^2.2.1 => 2.2.1
  gatsby-plugin-prefetch-google-fonts: ^1.4.3 => 1.4.3
  gatsby-plugin-react-helmet: ^3.1.7 => 3.2.1
  gatsby-plugin-sharp: ^2.2.22 => 2.5.4
  gatsby-plugin-sitemap: ^2.2.12 => 2.3.1
  gatsby-plugin-svgr: ^2.0.2 => 2.0.2
  gatsby-remark-copy-linked-files: ^2.1.19 => 2.2.1
  gatsby-remark-images: ^3.1.22 => 3.2.2
  gatsby-remark-prismjs: ^3.3.13 => 3.4.1
  gatsby-remark-relative-images: ^0.2.3 => 0.2.3
  gatsby-source-filesystem: ^2.1.22 => 2.2.2
  gatsby-transformer-remark: ^2.6.22 => 2.7.1
  gatsby-transformer-sharp: ^2.2.14 => 2.4.4
@azhang azhang added the type: bug An issue or pull request relating to a bug in Gatsby label Jun 8, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 8, 2020
@danabrit
Copy link
Contributor

danabrit commented Jun 9, 2020

Hi @azhang !

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

Thanks for using Gatsby! 💜

@danabrit danabrit added status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 9, 2020
@LekoArts
Copy link
Contributor

Hi!

Since we didn't receive an answer for 7 days or more about the ask of a reproduction I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or reopen the issue. Thanks!

@azhang
Copy link
Author

azhang commented Sep 2, 2020

@danabrit sorry for the slow response, it seems like it was fixed in #25894 :D

@MymmiJ
Copy link

MymmiJ commented Mar 30, 2022

I still get the issue in this PR on both build and develop in Gatsby 4.10.3, has the change been reverted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs reproduction This issue needs a simplified reproduction of the bug for further troubleshooting. type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

4 participants