Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't use normal Netlify functions when SSR enabled #114

Closed
@srcn

Description

@srcn

Describe the bug
When using the SSR runtime, normal Netlify (non-edge) functions are not working. Not sure if this is by design but I don't have this problem when using Next.js. Normal functions are working fine when using SSR in my Next.js apps.

angular-runtime/src/helpers/setUpEdgeFunction.js

excludedPath: ${JSON.stringify(excludedPaths)},

Shouldn't the excludedPath include .netlify and possible other internal URLs of Netlify?

Everything redirects back to the app itself. I figured that because even without any redirect rules, app works fine whereas without a /* /index.html 200 redirect, direct access to any url should result with the Netlify's internal 404 page which it does for the non-SSR version.

To Reproduce
Example repo with a clean Angular v18 installation with SSR enabled and a single function.

It's deployed at https://vermillion-cat-89e180.netlify.app/

The function is deployed at https://vermillion-cat-89e180.netlify.app/.netlify/functions/hello but accessing it would render the app with an Error on the console that says there is no Route for the url because Angular tries to render the url.

I tried adding redirect rules but since SSR apps are not subject to redirect rules, they don't solve the problem.

--

Example repo without SSR but with exact same setup with the SSR one; Angular v18 and a single function.

The function is deployed at https://stellar-horse-4fc8e6.netlify.app/.netlify/functions/hello and works fine.

Expected behavior
I should be able to trigger normal functions when using SSR. As a workaround, I'm currently using edge functions since the ones that are defined in netlify.toml file triggered before the runtime but they are not versioned like normal functions so they are not really a replacement for normal functions.

Versions

  • Angular: v18.0.0
  • plugin: Latest, auto installed from Netlify's dashboard

If you're using the CLI to build

  • OS: [e.g. macOS, Windows]
  • netlify/cli version:

If you're using file-based installation

  • netlify.toml:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions