-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Building static HTML for pageserror: Error: ENOENT: no such file or directory #10457
Comments
Ok, so I had this issue: #10458 I run |
I deleted my public folder and build again, same error again. I deleted cache folder and build and now it worked. |
Hello! Sorry about the issues! Could you provide a reproduction or something we could take a look at? Thanks! |
I can't... is just in my project and I don't have a clue about what is affecting this. It's incredibly flaky. |
If it's something that happens every X times, e.g. every ~5 times or something, and you can reproduce it occasionally that's still more to go on that we have now. It's pretty challenging to know how to begin debugging this. At first glance, it could be some type of Windows pathing issue, but that's a shot in the dark at this point. Thanks! |
If I run |
That's enough for us to go on! Is it possible to share the repository (or create a minified example without any private info) so we could take a look ourselves? |
I can't right now, is pretty big and entangled... What can we do? |
We do output query results to |
@pieh Looks like it's correct. So probably we should do something to avoid this scenario. Maybe put an error that in order to build without But I found it strange for the |
So this is kind of to eliminate some of the "unnecessary" work - like if we output query results to |
@hackhat this a bit of a edge case, normally people don't even touch these folders, or if they do they delete both of them, either by using a script, or using an auxiliary package to handle that situation. |
We can maybe add a Apologies for the not very helpful error messages. We are working towards improving this. |
@sidharthachatterjee Ok, cool. Thanks. @pieh I'm not sure how would that work when you build for dev vs build for prod. Looks like the prod build uses dev assets. I don't feel very safe about it, but looks like has no problems for now. @jonniebigodes I think the code should do its best to avoid developer mistakes. For example rememering to delete .cache before you build is an antipattern. Why not delete the .cache folder when you run the build automatically? You will do one mistake at one point. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
I just ran into this as well. For future people: the tl; dr is that when making a fresh build, delete both |
@lionelbarrow could you share some context as to why you deleted the public folder to begin with? We're trying to track down caching issues in #11747, so any insight you have would be invaluable--particularly if it's reproducible! Thanks! |
Also side note: You can also use |
Not sure if it's related but I found this issue ^ while googling a solution... I am running
|
Same here |
But |
After executing
|
Hi, I had the same Error. It occured after successfully building the project. 5min later when I was trying to execute So Occurring Error: |
Having the same issue here even after deleting both the |
Hi. Having the same error. Also I get this output every time I run gatsby serve:
|
Are you trying to use Firebase? |
For a frontline story of how the public folder can grow rather large and how that can bring down a project surprisingly see this issue in the zeit community: https://spectrum.chat/zeit/general/help-i-just-hit-a-deployment-limit-during-a-critical-deployment~6c7c0fb2-4822-4a54-9a20-fd9abb3d1f21 |
Well, maybe you have to log in for that community. Here the long story short:
Minus 9'400 files! After this deployment worked again :-)
Reading this after writing it makes me realize just how bad I had timed this :-| |
I was running into this issue as well trying to use Firebase. Ended up following this guide which 'lazy' imports Firebase on There's also this starter template if anyone else was trying to do this: https://github.com/muhajirdev/gatsby-starter-firebase |
I'm getting the same issue and I'm using firebase |
Our production build will always fail exactly this way:
Unless I delete Environment
|
We have encountered this issue on a CICD environment where we cache If we eliminate the cache then builds will be slow again... 😢 |
I am having a similar issue using Firebase 6.5.0, When i change the firebase version to 5.9.0 the build works fine without issues. Anyone solved this when using firebase? |
I fixed this error by switching to http calls rather than trying to call the cloud function from firebase. |
Am using firebase auth and firestore in my case. I would want to continue using it this way but find a fix that would work on the latest version |
@josephkandi I am having the same issue as well. I'm going to try rolling back to 5.9.0 and see what happens. |
I had the same problem it should be standard to run gastby clean before build to avoid this error |
Was your issue related to the firebase package? |
I don't think so but it got solved as well just by clean before building the same way so many other people have solve it, so the out of the box gatsby build command should include clean and that way a common error could be avoided. |
Because this seems to be the thread to discuss I am not so good with webpack configuration, maybe somebody could come up with a gatsby workaround for the problem? All solutions on the mentioned ticket are not for gatsby |
firebase/firebase-js-sdk#1455 (comment) |
Solved using lazy firebase init explained here #8612 |
Oh my god. I debugged this for a long time. I thought it was the We delete the public folder in our It's not unreasonable to think this would be fine. |
I was having CI build issues. I was caching /.cache/ but not ./public/ and that caused this error to happen. Keeping both or deleting both will fix this issue as it is appear. I have a small worry though. I see alot of people here talking about "always cleaning both" but that is definitely a no-go as build time is a critical factor. So my only option is to keep both, but I fear that will lead to remnants of old builds being deployed with new statics. The design decision of keeping cached stuff in the build output folder is a weird one. File copy time and disk space is insignificant to most people compared to query speed. At the very least the error message in this code path should be changed to something like "./.cache was expecting file /page-data.json to be present in public/ folder. If this was deleted, please delete both .cache/ and public/ or run gatsby clean to avoid this issue" |
I had the same issue. Thank you. I had deleted the |
Description
I'm getting a lot of similar errors to this:
and then hangs with " Building static HTML for pages" for long time.
Steps to reproduce
Don't know... Just deleted the public folder and build it.
Environment
Run
gatsby info --clipboard
in your project directory and paste the output here. Not working? You may need to update your global gatsby-cli -npm install -g gatsby-cli
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
Binaries:
Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 5.5.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 42.17134.1.0
npmPackages:
gatsby: ^2.0.67 => 2.0.67
gatsby-image: ^2.0.25 => 2.0.25
gatsby-plugin-catch-links: ^2.0.9 => 2.0.9
gatsby-plugin-emotion: ^3.0.1 => 3.0.1
gatsby-plugin-google-analytics: ^2.0.8 => 2.0.8
gatsby-plugin-manifest: ^2.0.12 => 2.0.12
gatsby-plugin-offline: ^2.0.19 => 2.0.19
gatsby-plugin-react-helmet: ^3.0.0 => 3.0.0
gatsby-plugin-sharp: ^2.0.15 => 2.0.15
gatsby-plugin-sitemap: ^2.0.3 => 2.0.3
gatsby-plugin-typescript: ^2.0.3 => 2.0.3
gatsby-plugin-typography: ^2.2.2 => 2.2.2
gatsby-remark-component: ^1.1.3 => 1.1.3
gatsby-remark-images: ^3.0.1 => 3.0.1
gatsby-source-filesystem: ^2.0.12 => 2.0.12
gatsby-transformer-remark: ^2.1.15 => 2.1.15
gatsby-transformer-sharp: ^2.1.9 => 2.1.9
The text was updated successfully, but these errors were encountered: