我的Next.js应用程序昨天运行良好,但今天它有这样的错误:
error - ./node_modules/@urql/core/dist/ddbb86ae.mjs:1:0
Module not found: Can't resolve 'graphql'
Import trace for requested module:
./node_modules/@urql/core/dist/urql-core.mjs
./node_modules/urql/dist/urql.es.js
./pages/_app.js
https://nextjs.org/docs/messages/module-not-found
我不知道发生了什么事,所以我git reset --hard
,但问题仍然存在。请帮助我解决它。我很感激。
_应用程序.js:
import { StateContext } from "../lib/context";
import { Provider, createClient } from "urql";
const client = createClient({ url: "http://localhost:1337/graphql" });
function MyApp({ Component, pageProps }) {
return (
<StateContext>
<Provider value={client}>
<Nav />
<Component {...pageProps} />
</Provider>
</StateContext>
);
}
export default MyApp;
1条答案
按热度按时间bvjxkvbb1#
希望这能解决你的问题
或