Webpack Checks Failure in TypsScript Functions Repository

When trying to upgrade a TypeScript Functions repo to the latests version, I’ve been getting the error:

> Task :functions-typescript:typescriptWebpack FAILED
[webpack-cli] Error: Unknown keyword formatMinimum
    at get (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/schema-utils/node_modules/ajv-keywords/dist/index.js:25:15)
    at ajvKeywords (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/schema-utils/node_modules/ajv-keywords/dist/index.js:10:13)
    at /app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/schema-utils/dist/validate.js:65:3
    at /app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/schema-utils/dist/validate.js:42:5
    at validateObject (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/schema-utils/dist/validate.js:208:22)
    at validate (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/schema-utils/dist/validate.js:187:14)
    at new TerserPlugin (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/terser-webpack-plugin/dist/index.js:171:5)
    at Object.apply (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/webpack/lib/config/defaults.js:1447:5)
    at WebpackOptionsApply.process (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/webpack/lib/WebpackOptionsApply.js:580:16)
    at createCompiler (/app/ri.jemma.main.job.0000000d-5cd9-a8b0-937f-420c70d17b6b-a04566d6-37bc-4922-bd40-6e32273f380b/repo/functions-typescript/node_modules/webpack/lib/webpack.js:94:28)
Task :typescriptWebpack took 0.482 secs

Which then fails the checks and I can’t publish the changes.

All the tests in the repo pass, but something in the publishing process doesn’t seem to be working, and perhaps some dependcies have become confused?

If I try to update the repo again, it just changes the package-lock.json, but I don’t think it’s actually changing any package versions, just shuffling the order in which they appear.

Anyone who knows anything about NPM able to help please?

Hi @green , could you try clearing the contents of the package-lock.json file and committing that?

3 Likes

Thanks. Clearing that out and then committing it solved the issue.

Glad this resolved this issue. Though we make a best-effort attempt at having automated upgrades require no manual action, at times subtleties in NPM package management / merging in new package-lock.json changes can cause dependency resolution to not work as expected. The simplest fix for this class of issues is to do a fresh resolution of the dependency tree on the upgrade branch.

1 Like