Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.13k stars 1.68k forks source link

EISGIT error when trying to deploy to Vercel: Appears to be a git repo or submodule. #3701

Closed timfuhrmann closed 3 years ago

timfuhrmann commented 3 years ago
Environment
Steps to reproduce
  1. Install the latest version of dash.js using npm
  2. Try to deploy to Vercel
Observed behavior

Build fails throwing the EISGIT error.

Regenerating package-lock.json or ignoring build cache resolves the issue for the initial deployment, the second one will fail again.

Console output
npm ERR! code EISGIT
npm ERR! path /vercel/path0/node_modules/dashjs
npm ERR! git /vercel/path0/node_modules/dashjs: Appears to be a git repo or submodule.
npm ERR! git     /vercel/path0/node_modules/dashjs
npm ERR! git Refusing to remove it. Update manually,
npm ERR! git or move it out of the way first.

No problems observed on local machine.

zbauman3 commented 3 years ago

+1

davemevans commented 3 years ago

Seems the npm postinstall step defined in package.json always installs the precommit hook into the local .git/hooks/pre-commit folder. This causes a .git folder to exist within node_modules/dashjs, which in turn causes the OP's error where dashjs is a dependency.

This postinstall step should probably only be done if being installed "locally" ie for development, rather than as a dependency, since library users wouldn't need the commit hook anyway.

How to acheive this, 🤷