When running ntl dev for the Netlify Functions template it errors out with Error: remix dev is not supported for custom servers.
To Reproduce
Steps to reproduce the behavior:
Run npx create-remix --template netlify/remix
Follow the steps in the Remix CLI
Choose TypeScript or JavaScript, it doesn't matter
When prompted from the Remix CLI, choose to use Netlify Functions
Switch to the root directory of the generated project in your shell of choice
Run ntl dev
The following error occurs:
Error: remix dev is not supported for custom servers.
at Object.serve (/Users/yo/dev/issues/remix-func/node_modules/@remix-run/dev/dist/devServer/serve.js:41:11)
at Object.dev (/Users/yo/dev/issues/remix-func/node_modules/@remix-run/dev/dist/cli/commands.js:204:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async dev (/Users/yo/dev/issues/remix-func/node_modules/@remix-run/dev/dist/cli/run.js:187:3)
at async Object.run (/Users/yo/dev/issues/remix-func/node_modules/@remix-run/dev/dist/cli/run.js:464:7)
◈ Command failed with exit code 1: npm run dev. Shutting down Netlify Dev server
Expected behavior
Running ntl dev for the Netlify Functions templated project should start the site for local development.
To fix this, add the following to the remix.init/netlify-toml file
[build]
command = "remix build"
publish = "public"
+ [dev]
+ command = "remix watch"
+ port = 3000
[[redirects]]
from = "/*"
to = "/.netlify/functions/server"
status = 200
[[headers]]
for = "/build/*"
[headers.values]
# Set to 60 seconds as an example. You can also add cache headers via Remix. See the documentation on [headers](https://remix.run/docs/en/v1/route/headers) in Remix.
"Cache-Control" = "public, max-age=60, s-maxage=60"
Describe the bug
When running ntl dev for the Netlify Functions template it errors out with
Error: remix dev is not supported for custom servers.
To Reproduce Steps to reproduce the behavior:
npx create-remix --template netlify/remix
ntl dev
Expected behavior
Running
ntl dev
for the Netlify Functions templated project should start the site for local development.To fix this, add the following to the remix.init/netlify-toml file
This is how it is set in the template currently residing in the Remix repo. https://github.com/remix-run/remix/blob/main/templates/netlify/netlify.toml#L5-L7
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.