Loaded function not found in developement

I have written a function that works in production but cannot get it to work locally.

Notice the function is loaded but when called, cannot be found.

Screenshot of directory structure

Screen Shot 2022-06-09 at 11.08.12 AM

toml file

  command = "make production"
  command = "make staging"
  node_bundler = "esbuild"
  skip_processing = false
  bundle = true
  minify = true
  bundle = true
  minify = true
  pretty_urls = true
  compress = false

Hey @hashmaster3k

Functions are only accessible via the Netlify CLI dev port (8888 by default), though it appears you are trying to access the function via the Jekyll dev port 4000.


I’ve updated my toml as such:

  port = 8888
  command = "bundle exec jekyll serve --port 8888"

When running netlify dev I now see: “Server address:”. However, I still get the function not found error.

You are instructing Jekyll to run on port 8888 which means Netlify CLI cannot run on it. Remove this new configuration.

When you run netlify dev does the terminal output finish with the line Server now ready on http://localhost:8888?


I do not see that box/message. See below for what is displayed after running netlify dev

Then Netlify dev server is not starting correctly. This is possibly an issue with the configuration of the project, or an issue with Netlicy CLI.

Thanks I will open an issue on the the repository.

If anyone else run’s into this issue, this ticket identifies that running node 17 or higher is the issue. Downgrading to node 16 solves the problem.

1 Like

Thanks for coming back and sharing that, @hashmaster3k. Glad you found a solution. Happy building :rocket: