Skip to content

"top-level-await" error in Next.js 13 project #13419

Closed Answered by garfield786
theDanielJLewis asked this question in Q&A
Discussion options

You must be logged in to vote

This worked for me, in your next.config.js put the following

export const webpack = (config) => {
  config.experiments = { ...config.experiments, topLevelAwait: true };
  return config;
};

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@Piyusharora2003
Comment options

@vkarpov15
Comment options

@theDanielJLewis
Comment options

@Piyusharora2003
Comment options

@vamshimorlawar
Comment options

Comment options

You must be logged in to vote
1 reply
@vkarpov15
Comment options

Answer selected by vkarpov15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants