-
I'm following the Jokes tutorial and stumbled upon an error after creating the
Here's my {
"private": true,
"name": "remix-app-template",
"description": "",
"license": "",
"scripts": {
"build": "remix build",
"dev": "remix dev",
"postinstall": "remix setup node",
"start": "remix-serve build"
},
"dependencies": {
"@prisma/client": "^3.7.0",
"@remix-run/react": "^1.1.1",
"@remix-run/serve": "^1.1.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"remix": "^1.1.1"
},
"devDependencies": {
"@remix-run/dev": "^1.1.1",
"@types/react": "^17.0.24",
"@types/react-dom": "^17.0.9",
"prisma": "^3.7.0",
"typescript": "^4.1.2"
},
"engines": {
"node": ">=14"
},
"sideEffects": false
} I managed to make the error go away by adding a simple loader function: export const loader: LoaderFunction = async () => {
return null
} I wonder if I'm doing something wrong or maybe the tutorial is not 100% in line with the latest version of Remix? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If this loader is the entire contents of your |
Beta Was this translation helpful? Give feedback.
If this loader is the entire contents of your
app/routes/jokes/index.tsx
file, then the error makes sense. Routes must export either a component or a loader or both. If it doesn't, but the file exists, then Remix rightfully fails because of that.