-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Starting with Node.js 20, we are introducing a breaking change where entry point errors will block your function app from running. The most common error is this:
Worker was unable to load entry point "index.js": File does not exist
Workaround
NOTE: If you're on Node.js <20, you can technically ignore the error and your app will work just fine, but we still recommend following the workaround to get rid of the error.
The entrypoint is specified by the "main" field in your package.json. For the most common error mentioned above, you can workaround it by removing the "main" field entirely from your "package.json", assuming you don't actually have an "index.js" file you want to use.
Most other errors will have a fix specific to your own code, which will need to be addressed for your app to properly run.
Background
We introduced support for an entry point file in Fall of 2022, however at the time we made it a non-blocking warning to maintain backwards compatibility for apps that "worked" even though they had invalid entry point files. An entry point file is optional for programming model v3, but required for programming model v4 (Read more about the different models here). In the vast majority of cases, a v4 model app will not work if you have an entry point error, which is why we wanted to make these errors very obvious/blocking starting with Node 20.