Skip to content

Commit

Permalink
[Next.js][Middleware] start:production 'Dynamic Code Evaluation' error (
Browse files Browse the repository at this point in the history
  • Loading branch information
illiakovalenko authored Jun 23, 2022
1 parent d2b846a commit 079424a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@ export const getStaticProps: GetStaticComponentProps = async (rendering, layoutD
apiKey: config.sitecoreApiKey,
});

const result = await graphQLClient.request<GraphQLConnectedDemoData>(ConnectedDemoQueryDocument, {
datasource: rendering.dataSource,
contextItem: layoutData?.sitecore?.route?.itemId,
language: layoutData?.sitecore?.context?.language,
});
const result = await graphQLClient.request<GraphQLConnectedDemoData>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ConnectedDemoQueryDocument as any,
{
datasource: rendering.dataSource,
contextItem: layoutData?.sitecore?.route?.itemId,
language: layoutData?.sitecore?.context?.language,
}
);

return result;
};
Expand All @@ -135,11 +139,15 @@ export const getServerSideProps: GetServerSideComponentProps = async (rendering,
apiKey: config.sitecoreApiKey,
});

const result = await graphQLClient.request<GraphQLConnectedDemoData>(ConnectedDemoQueryDocument, {
datasource: rendering.dataSource,
contextItem: layoutData?.sitecore?.route?.itemId,
language: layoutData?.sitecore?.context?.language,
});
const result = await graphQLClient.request<GraphQLConnectedDemoData>(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ConnectedDemoQueryDocument as any,
{
datasource: rendering.dataSource,
contextItem: layoutData?.sitecore?.route?.itemId,
language: layoutData?.sitecore?.context?.language,
}
);

return result;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"license": "Apache-2.0",
"dependencies": {
"@sitecore-jss/sitecore-jss-nextjs": "^21.0.0-canary",
"graphql": "~15.4.0",
"graphql": "~15.8.0",
"graphql-tag": "^2.11.0",
"next": "^12.1.6",
"next-localization": "^0.12.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"axios": "^0.21.1",
"chalk": "^4.1.0",
"debug": "^4.3.1",
"graphql": "^15.4.0",
"graphql": "^16.5.0",
"graphql-request": "^4.2.0",
"lodash.unescape": "^4.0.1",
"memory-cache": "^0.2.0",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4152,7 +4152,7 @@ __metadata:
debug: ^4.3.1
del-cli: ^4.0.1
eslint: ^7.15.0
graphql: ^15.4.0
graphql: ^16.5.0
graphql-request: ^4.2.0
lodash.unescape: ^4.0.1
memory-cache: ^0.2.0
Expand Down Expand Up @@ -13116,10 +13116,10 @@ __metadata:
languageName: node
linkType: hard

"graphql@npm:^15.4.0":
version: 15.7.2
resolution: "graphql@npm:15.7.2"
checksum: eacb746e2981d0c346ef7365601873963af5356f64ce4d890ab89d213c67bf5bc1ae957b93c3902198798774c842b55dff219f38bad858691765e4debc265750
"graphql@npm:^16.5.0":
version: 16.5.0
resolution: "graphql@npm:16.5.0"
checksum: a82a926d085818934d04fdf303a269af170e79de943678bd2726370a96194f9454ade9d6d76c2de69afbd7b9f0b4f8061619baecbbddbe82125860e675ac219e
languageName: node
linkType: hard

Expand Down

0 comments on commit 079424a

Please sign in to comment.