question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build is failing | Module '"@vercel/fetch"' has no exported member 'Response'. Did you mean to use 'import Response from "@vercel/fetch"' instead?

See original GitHub issue

I just pulled the repo to test out the demo and the build is failing:

$ npm run build

nextjs-commerce@1.0.0 build /Users/Temp/commerce next build

next.config.js { “commerce”: { “features”: { “cart”: false, “search”: false, “wishlist”: false, “customerAuth”: false, “customCheckout”: false }, “provider”: “local” }, “i18n”: { “locales”: [ “en-US”, “es” ], “defaultLocale”: “en-US” }, “images”: { “domains”: [ “localhost” ] }, “env”: {} } Failed to compile.

./framework/commerce/api/index.ts:2:29 Type error: Module ‘“@vercel/fetch”’ has no exported member ‘Response’. Did you mean to use ‘import Response from “@vercel/fetch”’ instead?

1 | import type { NextApiHandler } from ‘next’ 2 | import type { FetchOptions, Response } from ‘@vercel/fetch’ 3 | import type { APIEndpoint, APIHandler } from ‘./utils/types’ 4 | import type { CartSchema } from ‘…/types/cart’ 5 | import type { CustomerSchema } from ‘…/types/customer’ info - Checking validity of types .npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! nextjs-commerce@1.0.0 build: next build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the nextjs-commerce@1.0.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
johnmasonwilliamscommented, Jan 19, 2022

Local add to cart doesn’t work for me either. Might be something to do with localhost not being allowed for Shopify storefront api? No idea…

1reaction
zhaodadicommented, Nov 13, 2021

Not an expert on typescript, i followed the error suggestion by removing the Reponse import and added this: import Response from ‘@vercel/fetch

build seems fine now

BTW u also need to update the errors.ts file too (the build error will lead u to it)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve the "module has no exported member" error?
Remove the line below from your statement export module Demo. and use it like export class ViewModel { constructor(public test: string) { }...
Read more >
Unable to resolve "@pnp/graph"' has no exported member ...
Now, while using 'import { graph } from "@pnp/graph"' I am getting below error. '"@pnp/graph"' has no exported member named 'graph'. Please ...
Read more >
'"react-router-dom"' has no exported member named 'redirect'
It seems you are not using the latest version (v6) of react-router-dom. ... I am trying to import useNavigate to use it as...
Read more >
Module '"react"' has no exported member 'useDeferredValue'.
For some reason, I can't seem to use React 18 features in my react application? App: import React, { ChangeEvent, FC, useEffect, useRef, ......
Read more >
Module '"@microsoft/sp-http"' has no exported member ...
Also I noted the definition for SPHttpClientBatch has been excluded in the node modules @microsoft/sp-http. Is SPHttpClientBatch not supported ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found