Skip to content

Site fails to execute functions within a pnpm monorepo #470

@robations

Description

@robations

Describe the bug A clear and concise description of what the bug is.

Although static assets are served by netlify serve, no functions seem to be working and the index of the site (http://localhost:8888/) returns "404 Not Found".

To Reproduce Steps to reproduce the behavior:

  1. Generate a new site npx create-remix@latest --template netlify/remix-template
  2. (choosing functions, rather than edge)
  3. Test the site working
  4. Translocate site as a workspace within a pnpm monorepo:
    a. add missing dependencies (pnpm complains about react and react-dom missing)
    b. I had an issue with netlify-cli trying to run an unrelated workspace package (which also happens to have a netlify.toml file): added build.base: "packages/remix-netlify"
    c. tsconfigPaths was reporting errors in unrelated packages (added root parameter)
    d. Delete package-lock.json and node_modules
    e. Reinstall repo deps with pnpm i
  5. Test the site within monorepo working correctly with remix vite:dev
  6. netlify serve fails with 404 error at root of site and .netlify/functions-serve is missing (compared with original site)
  7. Static client assets are served correctly (favicon.ico and CSS/JS under /assets/...)

Expected behavior A clear and concise description of what you expected to happen.

The site should work within a monorepo, or would expect some simple configuration to make it work.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: n/a
  • Version: @netlify/remix-adapter: 2.5.1

Smartphone (please complete the following information):

  • Device: n/a
  • OS: n/a
  • Browser n/a
  • Version n/a

Additional context Add any other context about the problem here.

Can potentially create a new monorepo for testing if not easily reproducible.

It seems like part of the Netlify code is still mis-identifying a path, but it's not clear what or where.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions