WebpackError: TypeError: apiFn is not a function

Error: Webpack Error

Works at localhost with out this issue. Support team please do help here. Trying to solution Netlify deployment for more than 3 weeks.

Site Name: dulcet-donut-68f21b.netlify.app

11:04:42 PM: error Page data from page-data.json for the failed page "/homesupplies/Humidifier ": {
11:04:42 PM: “componentChunkName”: “component—src-templates-product-detail-js”,
11:04:42 PM: “path”: "/homesupplies/Humidifier ",
11:04:42 PM: “result”: {
11:04:42 PM: “pageContext”: {
11:04:42 PM: “name”: "Humidifier ",
11:04:42 PM: “id”: “Product_63d9354985bac51f189fecc6”,
11:04:42 PM: “product”: {
11:04:42 PM: “node”: {
11:04:42 PM: “name”: "Humidifier ",
11:04:42 PM: “strapiId”: “63d9354985bac51f189fecc6”,
11:04:42 PM: “id”: “Product_63d9354985bac51f189fecc6”,
11:04:42 PM: “category”: {
11:04:42 PM: “name”: “Home Supplies”,
11:04:42 PM: “pageName”: “homesupplies”,
11:04:42 PM: “description”: “Home Supplies”
11:04:42 PM: }
11:04:42 PM: }
11:04:42 PM: },
11:04:42 PM: “productId”: “Product_63d9354985bac51f189fecc6”
11:04:42 PM: }
11:04:42 PM: },
11:04:42 PM: “staticQueryHashes”:
11:04:42 PM: }
11:04:42 PM: failed Building static HTML for pages - 2.857s
11:04:42 PM: error Building static HTML failed for path "/homesupplies/Humidifier "
11:04:42 PM:
11:04:42 PM: 58 |
11:04:42 PM: 59 | try {
11:04:42 PM: > 60 | const result = apiFn(args, plugin.options)
11:04:42 PM: | ^
11:04:42 PM: 61 |
11:04:42 PM: 62 | if (result && argTransform) {
11:04:42 PM: 63 | args = argTransform({ args, result })
11:04:42 PM:
11:04:42 PM: WebpackError: TypeError: apiFn is not a function
11:04:42 PM:
11:04:42 PM: - api-runner-ssr.js:60
11:04:42 PM: gatsby-starter-default/.cache/api-runner-ssr.js:60:22
11:04:42 PM:
11:04:42 PM: - api-runner-ssr.js:53
11:04:42 PM: gatsby-starter-default/.cache/api-runner-ssr.js:53:11
11:04:42 PM:
11:04:42 PM: - static-entry.js:261
11:04:42 PM: gatsby-starter-default/.cache/static-entry.js:261:10
11:04:42 PM:
11:04:42 PM: - utils.js:169
11:04:42 PM: [gatsby-starter-default]/[@gatsbyjs]/reach-router/lib/utils.js:169:1
11:04:42 PM:
11:04:42 PM:
11:04:43 PM: ​
11:04:43 PM: “build.command” failed
11:04:43 PM: ────────────────────────────────────────────────────────────────
11:04:43 PM: ​
11:04:43 PM: Error message
11:04:43 PM: Command failed with exit code 1: CI= npm run build (Search results for '"non-zero exit code: 1"' - Netlify Support Forums)
11:04:43 PM: ​
11:04:43 PM: Error location
11:04:43 PM: In Build command from Netlify app:
11:04:43 PM: CI= npm run build
11:04:43 PM: ​
11:04:43 PM: Resolved config

This is not something we can help with. Something is wrong with your code or setup that’s giving this error. Check: Debugging HTML Builds | Gatsby (gatsbyjs.com)