-
Notifications
You must be signed in to change notification settings - Fork 35
build.command fail for netlify functions #1167
Comments
my real question is can zip-it-and-ship-it build scripts up the tree I.E. outside its directory or even subdirectories. can it build node_modules at all? |
Is this error happening during bundling or when trying to run the function? And yes zip-it-and-ship-it should be able to have files being imported from outside the functions dir and node_modules. |
it happens when the function is deployed here is a photo |
is there a example importing files outside of functions folder I have not found a working one and I tried many variations |
I just noticed that your [build]
command =
publish =
[functions]
directory = "api/dist/functions"
included_files = ["api/dist/**/*.js"] Does that help? Here are the docs: https://docs.netlify.com/configure-builds/file-based-configuration/#functions |
I tired this already it same error appears, i think i need to make external
modules and try esbuild
…On Mon, Aug 22, 2022, 6:04 AM Daniel Tschinder ***@***.***> wrote:
I just noticed that your included_files option is in the wrong section,
so it should look like
[build]command = publish =
[functions]directory = "api/dist/functions"included_files = ["api/dist/**/*.js"]
Does that help?
Here are the docs:
https://docs.netlify.com/configure-builds/file-based-configuration/#functions
—
Reply to this email directly, view it on GitHub
<#1167 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADEMKYVAAAFP73MRW5OZ323V2NGD5ANCNFSM553HRZQA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@danez I found out basically Your Netlify CLI doesn't work for Windows & MacOS system files or paths only if I was on Linux system. the serverless function is completely broken if I build off of a windows Netlify.toml file "Problems arise with some package locations and how the list in bundled ... but the biggest issue is that the Prisma client will build using Windows or OSX and Netlfiy deploys need a linux variant." here I working with Redwood dev redwoodjs/redwood#6260 |
I am deploying redwood graphql server on netlify via their deploy script netlify.toml
I get error its unable to access the imports or modules outside of the fuction server I have tried glob and direct include file without success.
Runtime.ImportModuleError - Error: Cannot find module '..\..\lib\auth' Require stack: - /var/task/api/dist/directives/requireAuth/requireAuth.js - /var/task/api/dist/functions/graphql.js - /var/task/graphql.js - /var/runtime/index.mjs
so at build at it builds the functions code but that code is accessing code outside of itself as shown in this tree, its trying acess imports from the lib folder but Cannot find it so I think its not bundling the other dist files
this is my netlify.toml file
The text was updated successfully, but these errors were encountered: