Skip to content

Add missing fs-extra build dependency#440

Open
reikjarloekl wants to merge 1 commit into
shridhar-tl:masterfrom
automaze-me:fix/add-fs-extra-build-dep
Open

Add missing fs-extra build dependency#440
reikjarloekl wants to merge 1 commit into
shridhar-tl:masterfrom
automaze-me:fix/add-fs-extra-build-dep

Conversation

@reikjarloekl

Copy link
Copy Markdown

Problem

post-build.cjs (run as the postbuild* step of every extension/app/web build) does:

const fs = require('fs-extra');

and uses APIs that Node's native fs does not provide — copySync, moveSync, emptyDirSync, writeJsonSync. However fs-extra is not declared anywhere in package.json.

On a clean checkout, pnpm install && pnpm build fails during post-build with:

Error: Cannot find module 'fs-extra'
    at .../post-build.cjs

(It only appears to work in environments where fs-extra happens to be hoisted/available from another source.)

Fix

Declare fs-extra in devDependencies so the build post-processing works from a fresh clone.

post-build.cjs requires 'fs-extra' and relies on APIs that native fs
does not provide (copySync, moveSync, emptyDirSync, writeJsonSync), but
the package was not declared in package.json. On a clean install the
post-build step of every extension/app build fails with
"Cannot find module 'fs-extra'".

Add fs-extra to devDependencies so the build works from a fresh clone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant