-
Notifications
You must be signed in to change notification settings - Fork 87
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
Clear publish directory before building #464
Comments
is this for the CLI? this is what https://github.com/netlify/netlify-plugin-nextjs/blob/main/src/lib/helpers/handleFileTracking.js is supposed to take care of |
Update: I am experiencing this issue. I cannot get my site to deploy. I had no problem deploying the starter app which I cloned. I found another post to the forums with the same issue. The differences I have noted between the starter app and mine are
The deploy logs are identical until it tries to copy files into the build directory This happens both in the Netlify UI and when using the Netlify CLI. Interestly,
|
@kandizzy hey! i forked the starter repo, upgraded to next 11.0.1 and used the noted build version, and i was able to deploy. you can see logs https://app.netlify.com/sites/happy-yalow-f6a8f1/deploys/60f9688891797ee107262897. i believe you may already have an index.html in your publish folder but not entirely sure. we'd need to see your exact code, deploy settings and/or netlify.toml. |
@lindsaylevine hi! yes, that's exactly what happened. I had an |
@kandizzy awesome, so your issue is fixed? (since you shouldnt need an index.html in your /public because of index.tsx presumedly using getStaticProps and trying to prerender into out) |
@lindsaylevine yes, I am able to deploy now. I did change my build command to |
hello! just want to report that i came across the same issue when migrating to next from create-react-app. CRA uses a
Deleting the file fixed my issue. Thanks! |
Would also like to confirm that deleting |
closing since this will not be an issue in the plugin rewrite |
Currently if
out
exists from a previous build, the build will fail as it refuses to overwrite the old assets. The build should clear the contents of the publish dir so that builds can happen. It needs to ensure that it hasn't accidentally been set to the root of the repo too.The text was updated successfully, but these errors were encountered: