You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: It's very possible that this issue could be solved on either end (11ty's or Netlify's). I understand I am asking about compatibility with a 3rd party and the resolution from 11ty's end may be "won't fix". Part of the reason of raising the issue here is to debug what is actually going wrong before deciding on a solution.
Netlify Functions do not work with the 11ty version 3 programmatic API. Due to the loss of the official serverless plugin, I am trying to recreate some functionality with Netlify Functions. However, it appears that new code in v3 is causing 11ty to not work with Netlify. In a simple reproduction, when calling new Eleventy() the module defaultConfig.js is not found.
Function demo has returned an error: Cannot find module '[path-to-repo]/11ty-netlify-function-mvp/.netlify/functions-serve/demo/node_modules/@11ty/eleventy/src/defaultConfig.js' imported from [path-to-repo]/11ty-netlify-function-mvp/.netlify/functions-serve/demo/node_modules/@11ty/eleventy/src/Util/Require.js
This may be due to how defaultConfig.js is loaded dynamically.
Operating system
MacOS various
Eleventy
3.0.0
Describe the bug
Netlify Functions do not work with the 11ty version 3 programmatic API. Due to the loss of the official serverless plugin, I am trying to recreate some functionality with Netlify Functions. However, it appears that new code in v3 is causing 11ty to not work with Netlify. In a simple reproduction, when calling
new Eleventy()
the moduledefaultConfig.js
is not found.Function demo has returned an error: Cannot find module '[path-to-repo]/11ty-netlify-function-mvp/.netlify/functions-serve/demo/node_modules/@11ty/eleventy/src/defaultConfig.js' imported from [path-to-repo]/11ty-netlify-function-mvp/.netlify/functions-serve/demo/node_modules/@11ty/eleventy/src/Util/Require.js
This may be due to how
defaultConfig.js
is loaded dynamically.eleventy/src/Util/Require.js
Lines 218 to 225 in aa713c5
It's notable that the file is not present in the
node_modules
folder thatnetlify dev
(Netlify CLI) produces.It seems like the newer esbuild method of bundling functions should solve this, but I haven't found that yet.
Reproduction steps
netlify dev
Expected behavior
All configuration and dependencies of 11ty should be available to Netlify Functions so that the programmatic API can work as intended.
Reproduction URL
https://git.philiprenich.com/philip/11ty-netlify-functions
Screenshots
No response
The text was updated successfully, but these errors were encountered: