Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

build.command fail for netlify functions #1167

@Gresliebear

Description

@Gresliebear

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

image

image

this is my netlify.toml file

[build]
command = "yarn rw deploy netlify"
publish = "web/dist"
functions = "api/dist/functions"
included_files = ["api/dist/*.js"]
# included_files = ["api/dist/directives/*"]
# included_files = ["api/dist/graphql/*"]
# included_files = ["api/dist/lib/*"]
# included_files = ["api/dist/services/*"]

# [functions]
# directory = "api/dist/"
  # [functions.directory2]
  #   directory2 = "api/dist/lib"
[dev]
  # yarn rw build --verbose && yarn rw prisma migrate deploy && yarn rw data-migrate up
  # To use [Netlify Dev](https://www.netlify.com/products/dev/),
  # install netlify-cli from https://docs.netlify.com/cli/get-started/#installation
  # and then use netlify link https://docs.netlify.com/cli/get-started/#link-and-unlink-sites
  # to connect your local project to a site already on Netlify
  # then run netlify dev and our app will be accessible on the port specified below
  framework = "redwoodjs"
  # Set targetPort to the [web] side port as defined in redwood.toml
  targetPort = 8910
  # Point your browser to this port to access your RedwoodJS app
  port = 8888

[[redirects]]
  from = "/*"
  to = "/200.html"
  status = 200

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions