-
-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serverless function has stopped working locally and in production #2414
Comments
We don’t automatically parse the functions directory location from your netlify.toml but do provide an option to specify it in the bundler plugin: https://www.11ty.dev/docs/plugins/serverless/#bundler-options Do those match up? |
I seem to be having the same issue where I get the error message `Cannot find module '/[root of project]/eleventy-serverless-map.json' Shouldn't it be looking inside the I can't seem to be able to figure this out, it seems like @zachleat any thoughts? |
I just ran into the same issue. There must be something wrong as the website has been functioning normally for 4 months when suddenly I see the same error: Interestingly this only affects production when the site is deployed from the Netlify UI or triggered by a push to the git repo: when I run the site locally using I am using Eleventy 2.0.1 and Netlify Cli 16.5.1 |
Okay so thanks to this thread, I found the solution. Add the following the netlify.toml file: |
Stale per project slipstream changes in #3074. |
Describe the bug
Hi, I have a serverless function that renders previews in Sanity.io (great feature!), but at some point over the course of the last month it stopped working. I've previously been able to get it to work (referenced in this previous issue I opened then closed) by moving the functions folder to the root of my mono repo because it seemed like the lambda functions weren't capable of working with a nested functions folder. Now ever since this new issue has popped up, when I run
netlify dev
locally from the root of the project (like I always did), I get the following error:Cannot find module '/[root of project]/eleventy-serverless-map.json'
I expect 11ty to be looking in the functions directory specified in my netlify.toml for this particular file but its looking in the root of the project which I believe is the issue. My
netlify.toml
file looks like the following:To Reproduce
Steps to reproduce the behavior:
Steps are a bit specific to my project.
1.Create a netlify functions folder at the root of a monorepo with a yarn configuration that builds the actual site to a subdirectory (in my case this is
web
).2. Account for this in netlify.toml by pointing build and dev commands to that directory.
3. Run
netlify dev
from the root of the project.4. Encounter issue.
Expected behavior
11ty serverless plugin looks in the functions folder for the generated serverless build files instead of in the root of the repository.
Environment:
The text was updated successfully, but these errors were encountered: