sitename: ‘neegzar’
domain: neegzar.com
Hey,
I have a problem with node-fluent-ffmpeg.
The solution is to add this environment variable:
'process.env.FLUENTFFMPEG_COV': false
(This is not the code I used, this is the solution provided here) - to add the environment varaible.
And so that’s what I did:
I’ve tried adding the environment EVERYWHERE but it still ignores this variable.
- I’ve tried to add as to netlify settings → Environment Variable
Image: Pasteboard - Uploaded Image
- I tried in netlify.toml file like this:
# Settings in the [build] context are global and are applied to
# all contexts unless otherwise overridden by more specific contexts.
# [build]
[build.environment]
FLUENTFFMPEG_COV = ""
# Production context: all deploys from the Production branch
# set in your site’s Branches settings in the UI will inherit
# these settings. You can define environment variables
# here but we recommend using the Netlify UI for sensitive
# values to keep them out of your source repository.
[context.production]
environment = { FLUENTFFMPEG_COV = "false" }
But everything I’ve tried still ignores this environment variable.
Build error:
────────────────────────────────────────────────────────────────
3:06:26 PM: 2. Functions bundling
3:06:26 PM: ────────────────────────────────────────────────────────────────
3:06:26 PM:
3:06:26 PM: Packaging Functions from .netlify/functions-internal directory:
3:06:26 PM: - render.js
3:06:26 PM:
3:06:26 PM: Packaging Functions from netlify/functions directory:
3:06:26 PM: - create-gallery-image.ts
3:06:26 PM: - is-production.ts
3:06:26 PM: - meta.js
3:06:26 PM: - record-mandala.ts
3:06:26 PM: - take-screenshot.js
3:06:26 PM: - test.cjs
3:06:26 PM:
3:06:28 PM: ✘ [ERROR] Could not resolve "./lib-cov/fluent-ffmpeg"
3:06:28 PM: node_modules/fluent-ffmpeg/index.js:1:56:
3:06:28 PM: 1 │ ...FMPEG_COV ? require('./lib-cov/fluent-ffmpeg') : require('./lib/... ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
3:06:29 PM:
3:06:29 PM: ────────────────────────────────────────────────────────────────
3:06:29 PM: Dependencies installation error
3:06:29 PM: ────────────────────────────────────────────────────────────────
3:06:29 PM:
3:06:29 PM: Error message
3:06:29 PM: A Netlify Function failed to require one of its dependencies.
3:06:29 PM: Please make sure it is present in the site's top-level "package.json".
3:06:29 PM: Build failed with 1 error:
3:06:29 PM: node_modules/fluent-ffmpeg/index.js:1:56: ERROR: Could not resolve "./lib-cov/fluent-ffmpeg"
3:06:29 PM:
3:06:29 PM: Resolved config
3:06:29 PM: build:
3:06:29 PM: command: npm run build
3:06:29 PM: commandOrigin: ui
3:06:29 PM: environment:
3:06:29 PM: - FLUENTFFMPEG_COV
3:06:29 PM: - VITE_AWS_ACCESS_KEY_ID
3:06:29 PM: - VITE_AWS_BUCKET_NAME
3:06:29 PM: - VITE_AWS_SECRET_ACCESS_KEY
3:06:29 PM: - VITE_GOOGLE_SPREADSHEETS_PRIVATE_NEEGZAR_API_KEY
3:06:29 PM: - VITE_MONGO_DB_URI
3:06:29 PM: publish: /opt/build/repo/build
3:06:29 PM: publishOrigin: ui
3:06:29 PM: functionsDirectory: /opt/build/repo/netlify/functions
3:06:29 PM: headers:
3:06:32 PM: - for: /_app/immutable/* values: cache-control: public, immutable, max-age=31536000 redirects: - from: '*' status: 200 to: /.netlify/functions/renderCaching artifacts
3:06:32 PM: Started saving node modules
3:06:32 PM: Finished saving node modules
3:06:32 PM: Started saving build plugins
3:06:32 PM: Finished saving build plugins
3:06:32 PM: Started saving pip cache
3:06:32 PM: Finished saving pip cache
3:06:32 PM: Started saving emacs cask dependencies
3:06:32 PM: Finished saving emacs cask dependencies
3:06:32 PM: Started saving maven dependencies
3:06:32 PM: Finished saving maven dependencies
3:06:32 PM: Started saving boot dependencies
3:06:32 PM: Finished saving boot dependencies
3:06:32 PM: Started saving rust rustup cache
3:06:32 PM: Finished saving rust rustup cache
3:06:32 PM: Started saving go dependencies
3:06:32 PM: Finished saving go dependencies
3:06:32 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:06:33 PM: Failing build: Failed to build site
3:06:33 PM: Finished processing build request in 45.765355418s