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
I wanted to try out Sanity.io and see if it'd be useful to integrate with a different site of mine, so I found this demo and the accompanying tutorial on the Eleventy docs website.
So, I made it through almost the entire tutorial successfully except I am stuck on the VERY LAST PART - my function is deployed, recognized, yet no matter what I do it results with "Invocation Failed":
Error: Cannot find module '/var/task/functions/userlibs/eleventy-serverless-map.json'
Require stack:
- /var/task/node_modules/@11ty/eleventy/src/Serverless.js
- /var/task/node_modules/@11ty/eleventy/src/Eleventy.js
- /var/task/index.js
- /var/task/userlibs.js
- /var/runtime/index.mjs
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
at Function.Module._load (node:internal/modules/cjs/loader:871:27)
at Module.require (node:internal/modules/cjs/loader:1098:19)
at require (node:internal/modules/cjs/helpers:108:18)
at Serverless.getContentMap (/var/task/node_modules/@11ty/eleventy/src/Serverless.js:105:12)
at Serverless.isServerlessUrl (/var/task/node_modules/@11ty/eleventy/src/Serverless.js:119:27)
at handler (/var/task/index.js:36:14)
Now, in addition, this tutorial gave me a couple other issues along the way. One is that I was meant to include:
in my .gitignore, but it would come up with an error when I ran "npm run build": Eleventy:EleventyFiles >>> When processing .gitignore/.eleventyignore, Eleventy does not currently support negative patterns but encountered one
So, thinking that may have been my issue, I created an .eleventyignore file and set eleventyConfig.setUseGitIgnore(false).
The other thing I can't fix is that, again while running "npm run build", I always see this: [11ty] ENOENT: no such file or directory, open 'C:\Users\...\madlibs-sanitytest\site\functions\userlibs\functions\userlibs\functions\userlibs\functions\userlibs\functions\userlibs\_data\madlibs.js' (via Error)
The specific file path does change depending on what small tweaks and changes I try to make to fix this, but nothing I do seems to be able to get rid of this error.
So TLDR: serverless function keeps throwing Invocation Failed - Cannot find module '/var/task/functions/userlibs/eleventy-serverless-map.json', which may or may not be related to a ! negation in my .gitignore, and may or may not also be related to the ENOENT: no such file or directory error. I've done so much googling and adjusting and for the life of me I can't figure this out!!!
P.S. I took two intro to comp-sci courses in university that taught me NOTHING about coding for websites so 99% of my knowledge is self-taught. My point is I don't have a solid foundation for any of this and I'm just stumbling around blind and figuring shit out as I go... So any help at all or even just an explanation as to what I've done (wrong) is very much appreciated!!!
Operating system
Windows 10 Version 22H2
Eleventy
2.0.0
Describe the bug
I wanted to try out Sanity.io and see if it'd be useful to integrate with a different site of mine, so I found this demo and the accompanying tutorial on the Eleventy docs website.
So, I made it through almost the entire tutorial successfully except I am stuck on the VERY LAST PART - my function is deployed, recognized, yet no matter what I do it results with "Invocation Failed":
Now, in addition, this tutorial gave me a couple other issues along the way. One is that I was meant to include:
in my .gitignore, but it would come up with an error when I ran "npm run build":
Eleventy:EleventyFiles >>> When processing .gitignore/.eleventyignore, Eleventy does not currently support negative patterns but encountered one
So, thinking that may have been my issue, I created an .eleventyignore file and set eleventyConfig.setUseGitIgnore(false).
The other thing I can't fix is that, again while running "npm run build", I always see this:
[11ty] ENOENT: no such file or directory, open 'C:\Users\...\madlibs-sanitytest\site\functions\userlibs\functions\userlibs\functions\userlibs\functions\userlibs\functions\userlibs\_data\madlibs.js' (via Error)
The specific file path does change depending on what small tweaks and changes I try to make to fix this, but nothing I do seems to be able to get rid of this error.
So TLDR: serverless function keeps throwing Invocation Failed - Cannot find module '/var/task/functions/userlibs/eleventy-serverless-map.json', which may or may not be related to a ! negation in my .gitignore, and may or may not also be related to the ENOENT: no such file or directory error. I've done so much googling and adjusting and for the life of me I can't figure this out!!!
P.S. I took two intro to comp-sci courses in university that taught me NOTHING about coding for websites so 99% of my knowledge is self-taught. My point is I don't have a solid foundation for any of this and I'm just stumbling around blind and figuring shit out as I go... So any help at all or even just an explanation as to what I've done (wrong) is very much appreciated!!!
Reproduction steps
Expected behavior
The demo website works perfectly fine, as you can see here: https://brob-madlibs.netlify.app/madlibs/call-me-ishmael/
Reproduction URL
https://github.com/wingsooyoung/madlibs-sanitytest
Screenshots
Invocation Error:
ENOENT Error:
Current package.json settings:
The text was updated successfully, but these errors were encountered: