I refactored my code to use process.env and env variables instead of hardcoding the front end and back end URLs, but the build keeps failing now. this is the readout:
7:16:00 PM: ❯ Current directory
7:16:00 PM: /opt/build/repo
7:16:00 PM:
7:16:00 PM: ❯ Config file
7:16:00 PM: No config file was defined: using default values.
7:16:00 PM:
7:16:00 PM: ❯ Context
7:16:00 PM: production
7:16:00 PM:
7:16:00 PM: 1. Build command from Netlify app
7:16:00 PM: ────────────────────────────────────────────────────────────────
7:16:00 PM:
7:16:00 PM: $ CI= npm run build
7:16:00 PM: > client@1.0.0 build
7:16:02 PM: > parcel build ./*.html
/opt/build/repo/landing.html:undefined:undefined: plugin is not a function
7:16:02 PM: at LazyResult.run (/opt/build/repo/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:288:14)
7:16:02 PM: at LazyResult.asyncTick (/opt/build/repo/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:212:26)
7:16:02 PM: at /opt/build/repo/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:254:14
7:16:02 PM: at new Promise ()
7:16:02 PM: at LazyResult.async (/opt/build/repo/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:250:23)
7:16:02 PM: at LazyResult.then (/opt/build/repo/node_modules/parcel-bundler/node_modules/postcss/lib/lazy-result.js:131:17)
7:16:02 PM:
7:16:02 PM: “build.command” failed
7:16:02 PM: ────────────────────────────
Hi Sam!
I’ve tried several of the debugging procedures in the documentation, but unfortunately it looks like I haven’t stumbled on the solution yet
this is my site: silly-salmiakki-307386
As mentioned, this page was built with Parcel and was working fine when I hardcoded the Front-end Netlify and Back-end Render URLS. However, once I refactored to use process.env the builds started failing (while they still work locally).
I’ve tried adding CI=" " to the start of my build command, which didn’t work. I’ve tried different environment configuration variables which hasn’t worked either. I also deprecated my Parcel to a previous version, but that didn’t help either. I’m sure there is a solution for this, but I haven’t been able to find it - apologies, I’m a newbie at deploying to prod.
Resolved. It appears this was a case sensitivity issue with the filenames. After making sure all filenames in the parcel build entry points were lowercase, I was able to successfully publish the site again. Oddly enough, this was not an issue before I moved to environment variables.