For Workers & Pages, what is the name of the domain?
N/A
What is the error number?
N/A
What is the error message?
ReferenceError: await is not defined
What is the issue or error you’re encountering
Issues to run NextJS
What steps have you taken to resolve the issue?
N/A
What are the steps to reproduce the issue?
Hi,
I am trying to create a new Next.js app that I will deploy to Cloudflare Pages. I am following the official documentation:
To create the new Next.js app I am using the npm command from Cloudflare in order to have a pre-configured app to run on Cloudflare Pages.
This is the command I used: npm create cloudflare@latest
However when my NodeJS app is ready and I use “npm run dev” it gives errors (ReferenceError: await is not defined).
I accidentally pressed enter without pasting the code and now I couldn’t edit my comment apparently due to my new account in this community, but here’s the code with the types removed:
import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to use bindings during local development
// (when running the application with `next dev`), for more information see:
// https://github.com/cloudflare/next-on-pages/blob/main/internal-packages/next-dev/README.md
if (process.env.NODE_ENV === 'development') {
await setupDevPlatform();
}
const nextConfig = {
/* config options here */
};
export default nextConfig;