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

[v2] [unconfirmed] Gatsby doesn't properly delete files on build #7942

Closed
vtenfys opened this issue Sep 6, 2018 · 8 comments
Closed

[v2] [unconfirmed] Gatsby doesn't properly delete files on build #7942

vtenfys opened this issue Sep 6, 2018 · 8 comments
Labels
status: awaiting author response Additional information has been requested from the author

Comments

@vtenfys
Copy link
Contributor

vtenfys commented Sep 6, 2018

@dfmarulanda has pointed out that gatsby build doesn't work reliably without first deleting the public folder - we should guarantee that running gatsby build over an existing build results in a working website.

@vtenfys
Copy link
Contributor Author

vtenfys commented Sep 6, 2018

/cc @pieh

@vtenfys vtenfys added the status: awaiting author response Additional information has been requested from the author label Sep 6, 2018
@vtenfys
Copy link
Contributor Author

vtenfys commented Sep 6, 2018

Just checked this on the latest commit of crowdswap/landing - I cloned, ran yarn install and gatsby serve and upon visiting localhost:9000, there were no problems.

@dfmarulanda I'm assuming this is a problem with how Azure is caching certain resources, since it's working perfectly for me - closing. Please let me know if you have any further issues, but I think this is an issue with your deployment rather than with Gatsby.

@vtenfys vtenfys closed this as completed Sep 6, 2018
@vtenfys
Copy link
Contributor Author

vtenfys commented Sep 6, 2018

OK. I'll try to change my deploy process. It's super easy to do it using netlify, aws, heroku, but there is no an azure plugin. There is a docker plugin working in the latest version of Gatsby?

@dfmarulanda (please make further replies in this issue, rather than #7355) I did some investigating and I think the issue could be caused by Azure not updating all the pages, rather than Gatsby - theoretically it should work if Azure deploys the public folder in git, since it works fine locally with your latest commit, without deleting or creating any files.

@vtenfys
Copy link
Contributor Author

vtenfys commented Sep 6, 2018

Having said that, I'd still recommend you try to build the site on Azure, rather than your current approach, since it would make the git repo easier to manage.

@KyleAMathews
Copy link
Contributor

This sounds like a bad npm/yarn install problem. The only possible issue with files in public is if you remove a page and then don't delete the html for that page. But we take care of that by deleting all HTML files at the start of a build.

@dfmarulanda
Copy link

dfmarulanda commented Sep 6, 2018

I deleted everything, indeed it worked perfectly for weeks. I changed my deployment process and now it's working perfectly. I decided to use Azure Blob Storage instead of Azure Web App. Working like a charm.

@hackhat
Copy link

hackhat commented Nov 2, 2018

I don't know but I just looked into my public folder and was huge of .map and .js.map files. I don't think they get wiped all the time properly.

@pieh
Copy link
Contributor

pieh commented Nov 2, 2018

@hackhat that's very good point, we should expand globs used in

// Delete html and css files from the public directory as we don't want
// deleted pages and styles from previous builds to stick around.
activity = report.activityTimer(
`delete html and css files from previous builds`,
{
parentSpan: bootstrapSpan,
}
)
activity.start()
await del([
`public/*.{html,css}`,
`public/**/*.{html,css}`,
`!public/static`,
`!public/static/**/*.{html,css}`,
])
activity.end()

to cover map files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting author response Additional information has been requested from the author
Projects
None yet
Development

No branches or pull requests

5 participants