I create a fresh Next.js project using:
npx create-next-app
Then I move into the folder, run npm run dev
and am getting the following error:
C:/Users/mikke/Documents/Projects/next-project/pages/_app.js 4:9
Module parse failed: Unexpected token (4:9)
You may need an appropriate loader to handle this file type, currently no loaders are
configured to process this file. See https://webpack.js.org/concepts#loaders
|
| function MyApp({ Component, pageProps }) {
> return <Component {...pageProps} />
| }
|
Very confused as to why this is happening. I first got the error deploying and then cloning this example: https://github.com/supabase/supabase/tree/master/examples/nextjs-todo-list
I've also tried removing node_modules and ./next and reinstalling dependencies, but no luck. What am I missing?
Edit: my _app.js (exact same as create-next-app default)
import '../styles/globals.css'
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
}
export default MyApp
pages/_app.js
file? – Ontario