Polyfill-service: 3.22.0 missing dist files on NPM

Created on 16 Oct 2017  路  7Comments  路  Source: Financial-Times/polyfill-service

The polyfills/__dist folder is missing on 3.22.0 on NPM, so the service fails to start with the error:

No polyfill sources found. Runnpm run buildto build them

Most helpful comment

@JakeChampion I've got yarn 1.0.2 installed. FWIW, the artifacts uploaded to NPM for 3.21.0 do contain the dist folder, and I don't see a postinstall step that runs npm run build or anything.

Actually, it looks like there's even a step that is intended to build the polyfills prior to releasing them to npm that may not have gotten run for whatever reason:

"prepublish": "npm run build"

All 7 comments

I think it's on purpose. You have to npm install && npm run build

It is meant to run npm run build automatically after it is installed. Which version of npm are you using @dcherman ?

@JakeChampion I've got yarn 1.0.2 installed. FWIW, the artifacts uploaded to NPM for 3.21.0 do contain the dist folder, and I don't see a postinstall step that runs npm run build or anything.

Actually, it looks like there's even a step that is intended to build the polyfills prior to releasing them to npm that may not have gotten run for whatever reason:

"prepublish": "npm run build"

I believe prepublish automatically runs on anpm install. Having the same issue with yarn as well.

I just investigated a bit further:

  1. The package has a .npmignore which excludes the /polyfills/__dist folder. This behaviour did not change since v3.22, so it is not the source of the missing files.
  2. The package includes a prepublish hook, which does run automatically after a npm install (like @gabemeola conjectured above), but apparently does not.

I am not sure why the hook runs in 3.21, but not in 3.22.

My workaround with yarn is to use a postinstall script my package.json.

"postinstall": "cd node_modules/polyfill-service && npm run build",

Confirmed that this was fixed up in 3.24.0. Thanks @JakeChampion

Was this page helpful?
0 / 5 - 0 ratings