I have been attempting to set up a “ShippingDiscount” function for a client.
Each time I do so, it comes back with the following error: -
Build failed with 1 error: │> │ extensions/shipping-discount/src/run.js:2:9: ERROR: No matching export in │> │ “extensions/shipping-discount/generated/api.ts” for import “DiscountApplicationStrategy” │> │ │> │ To investigate the issue, examine this stack trace: │> │ at (extensions/shipping-discount/src/run.js:2) │> │ import { DiscountApplicationStrategy } from “../generated/api”; │> │ at failureErrorWithLog (esbuild/lib/main.js:1650) │> │ let error = new Error(text); │> │ at (esbuild/lib/main.js:1058) │> │ const error = failureErrorWithLog(“Build failed”, originalErrors.concat(onEndErrors), │> │ originalWarnings.concat(onEndWarnings)); │> │ at (esbuild/lib/main.js:1003) │> │ buildOrContextContinue(null, (result, done) => done(, ), () => { │> │ at buildResponseToResult (esbuild/lib/main.js:1056) │> │ runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => { │> │ at (esbuild/lib/main.js:1085) │> │ return buildResponseToResult(response, (err, res) => { │> │ at
The problem seems to be the generated run.js is attempting to export a class named “DiscountApplicationStrategy” from the generated/api.ts file, which does not have it present.
I’ve tried adding it from a product function I had been working on but the api.ts file is reset each time the function is built.
Any advice on either a solution or workaround would be appreciated.
Rich
