Skip to content

index.html missing from build #9601

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

Closed
Download opened this issue Sep 7, 2020 · 15 comments
Closed

index.html missing from build #9601

Download opened this issue Sep 7, 2020 · 15 comments

Comments

@Download
Copy link

Download commented Sep 7, 2020

Describe the bug

After running the build, the index.html is missing from the /build folder.

Did you try recovering your dependencies?

Yes I did.

I followed these steps:

  • Delete node_modules folder
  • Remove package-lock.json
  • npm install -g npm@latest
  • npm install
C:\ws\dvoms>npm install -g npm@latest
C:\Users\stijn\AppData\Roaming\npm\npx -> C:\Users\stijn\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
C:\Users\stijn\AppData\Roaming\npm\npm -> C:\Users\stijn\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
+ [email protected]
added 434 packages from 885 contributors in 26.111s

C:\ws\dvoms>npm install
npm WARN deprecated @types/[email protected]: This is a stub types definition. testing-library__dom provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated @hapi/[email protected]: joi is leaving the @hapi organization and moving back to 'joi' (https://github.com/sideway/joi/issues/2411)
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

> [email protected] postinstall C:\ws\dvoms\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> [email protected] postinstall C:\ws\dvoms\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall C:\ws\dvoms\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall C:\ws\dvoms\node_modules\protobufjs
> node scripts/postinstall

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\react-scripts\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"<8.10.0"} (current: {"node":"10.16.3","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack-chokidar2\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN @tensorflow/[email protected] requires a peer of @tensorflow/tfjs-converter@~1.2.8 but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/[email protected] requires a peer of @tensorflow/tfjs-core@~1.2.8 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of sass@^1.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

added 2048 packages from 859 contributors and audited 2054 packages in 425.852s

79 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

C:\ws\dvoms>npm --version
6.14.8

Steps to reproduce

Run npm run build, then check whether index.html was generated successfully.

Expected behavior

It builds all project files, including index.html

Actual behavior

index.html is missing

C:\ws\dvoms>npm run build

> [email protected] build C:\ws\dvoms
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:


The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  bit.ly/CRA-deploy


C:\ws\dvoms>dir .\build\index.html
 Volume in drive C is SSD
 Volume Serial Number is 6A90-767E

 Directory of C:\ws\dvoms\build

File Not Found

Reproducible demo

Sorry I cannot provide this. Initially, run build worked as expected but it broke. I have not ejected and did not change anything about the build scripting afaik.

Related issue

Production Build Randomly Fails #1082

This issue describes exactly what I am seeing but was closed and locked.
EDIT: Ok, maybe not exactly. The OP of that issues says it works sometimes, but for me it is consistently failing now.

@Download
Copy link
Author

Download commented Sep 7, 2020

Mmmm it seems index.html is not the only thing that is missing. Also the bundle files are not generated.
Also, I created a fresh new app and build does work there. But I have no idea how to find out why in one project it works and in the other it doesn't. And there are no error messages in the failing build.

@Download
Copy link
Author

Download commented Sep 7, 2020

Ok I found the culprit.
I ignored yall's warnings about not using webpack import syntax.
I added a comment to disable the lint rule in the one file I needed to import a worker.
Got that idea from here:
developit/workerize-loader#5
This worked great in development but caused the build to fail silently.
So... my bad I guess.

However, I still think the build should actually fail instead of just not generating any output.

@Mosesquabina
Copy link

Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys'
Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys'

@stale
Copy link

stale bot commented Oct 12, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Oct 12, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

@stale stale bot closed this as completed Dec 25, 2020
@ch3ll0v3k
Copy link

ch3ll0v3k commented Jan 19, 2021

I have same error.
After building inside docker: 15.5.1-alpine3.10.
There is no index.html file.

image

@ch3ll0v3k
Copy link

I have updated react-* from 16.x.x to 17.1.0 and rebuild the project.
All related errors to previous post where gone.

@ch3ll0v3k
Copy link

ch3ll0v3k commented Jan 19, 2021

image

with this versions, have no probleem

@iota-pi
Copy link

iota-pi commented Jan 22, 2021

I had the same issue with the webpack import syntax for workerize-loader, and found this workaround worked for me. Basically create a .ts or .js files (instead of .tsx or .jsx) and use the webpack import syntax there and then import from the .ts/.js file as a regular import.

@Download
Copy link
Author

@iota-pi
Can you verify whether this works in a production build? I had everything working in dev, but then when I made a production build this problem appeared.

@iota-pi
Copy link

iota-pi commented Jan 22, 2021

@iota-pi
Can you verify whether this works in a production build? I had everything working in dev, but then when I made a production build this problem appeared.

Yes, the production build is successfully built when using this workaround.

@crklan
Copy link

crklan commented Jun 22, 2021

@Download Have you managed to find any other solution for this problem? The solution that @iota-pi suggested doesn't seem to work.

@Download
Copy link
Author

@crklan
I ended up removing workerize-loader. Not ideal but it fixed it.

@Namone
Copy link

Namone commented Feb 24, 2023

If using docker, it is also important to make sure you aren't pulling in a previously bad build that was cached.

@ZenulAbidin
Copy link

Just leaving this here, take care that your Node version is not too old. I was experiencing this problem with a project developed with the latest node version but then I saw the Node version I was trying to build with was v16 from the distro's package manager.

If you use --verbose during the build or check the generated debug file you can see that the runtime hits an exception before it can finish building, and that's why the files are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants