V4.5.1 erroring on script that previously worked

HI everyone,
New here, but this is a bit of a “pretty sure the release isnt working as expected” situation.
I saw there was a new release about 5 hours ago, and now I am getting this error when deploying the exact same way/code as about 12 hours ago. I updated pathing to remove home paths and other spcifics. Running on a mac. I will try rebooting in a moment, but I shouldnt need to.

I ran sudo npm i serverless -g as well to get the latest versions (I have serverless as a dev dependency with “^4” so should have got it. and looking in the .serverless folder in my home dir, I can see that release is present. Anyone have any ideas?

% npx serverless deploy --stage staging --region ap-southeast-2 --aws-profile staging --debug

s:core: {
node: ‘v22.9.0’,
os: ‘darwin’,
arch: ‘arm64’,
shell: ‘/bin/zsh’,
cwd: ‘/correctPath’,
nodeJsPath: ‘/opt/homebrew/Cellar/node/22.9.0/bin/node’,
scriptPath: ‘/homepath/.serverless/releases/4.5.1/package/dist/sf-core.js’,
scriptArgs: [
‘deploy’,
‘–stage’,
‘staging’,
‘–region’,
‘ap-southeast-2’,
‘–aws-profile’,
‘staging’,
‘–debug’
],
logLevel: ‘debug’,
isInteractive: true
}
s:core: { serverless_framework: ‘4.5.1’ }
s:main: Initializing
s:main: Initializing
s:core:router: {
command: [ ‘deploy’ ],
options: {
stage: ‘staging’,
region: ‘ap-southeast-2’,
‘aws-profile’: ‘staging’,
debug: ‘*’
},
versions: { serverless_framework: ‘4.5.1’ },
compose: undefined
}
s:core:router: ComposeRunner returned an empty customConfigFilePath, skipping
s:core:router: CfnRunner returned an empty customConfigFilePath, skipping
s:core:router: ContainersRunner returned an empty customConfigFilePath, skipping
s:core:router: TraditionalRunner returned an empty customConfigFilePath, skipping
s:resolve-variables-and-authenticate: Authenticating
s:core:resolver:manager: adding resolver provider self with config { type: ‘self’ }
s:core:resolver:manager: adding resolver provider file with config { type: ‘file’ }
s:core:resolver:manager: adding resolver provider opt with config { type: ‘opt’ }
s:core:resolver:manager: resolved ${opt:region, ‘ap-southeast-2’} to “ap-southeast-2”
s:core:resolver:manager: resolved ${opt:stage} to “staging”
s:main: Finalizing (and 1 more task)
s:core:router: Saving meta record to global .serverless directory.
s:core:router: Finalization failed: Cannot read properties of null (reading ‘handler’)
s:core:router:finalization-error-handler: Error during finalization: Error: Sending events failed: Cannot read properties of null (reading ‘handler’)
s:core:router:finalization-error-handler: Error during telemetry event handling: Cannot read properties of null (reading ‘handler’)
s:cli-error-handler: TypeError: Cannot read properties of undefined (reading ‘promiseResolved’)
at (/Users/gailmiller/.serverless/releases/4.5.1/sf-core/src/lib/resolvers/manager.js:731:60)
at Array.map ()
at _ResolverManager.#handlePlaceholderNode (/homepath/.serverless/releases/4.5.1/sf-core/src/lib/resolvers/manager.js:731:35)
at async (/homepath/.serverless/releases/4.5.1/sf-core/src/lib/resolvers/manager.js:578:11)
at async processNodeAndHandleCompletion (/homepath/.serverless/releases/4.5.1/sf-core/src/lib/resolvers/graph.js:33:5)

I am also facing problem in sls deploy or sls remove . cant deploy/remove services or function after latest update of serveless.

Same issue we me, any help is greatly appreciated

Facing similar issue, started getting this error on a code which was working earlier

> SyntaxError: Cannot use import statement outside a module

My issue was a bug that has now been fixed by the serverless team.

This issue is probably because of your tsconfig setup in conjunction with your package.json. You need to find out which of your packages is giving the error then use esbuild configuration to import that seperately.

serverless.yml:
build:
esbuild:
configFile: ./esbuildserverless.config.js

esbuildserverles.config.json:
import { nodeExternalsPlugin } from ‘esbuild-node-externals’;
export default (serverless) => {
return {
bundle: true,
minify: false,
sourcemap: false,
keepNames: true,
platform: ‘node’,
mainFields: [‘module’, ‘main’],
external: [‘list your packages here’],
plugins: [nodeExternalsPlugin()],
};
};

package.json:
dependencies: dont put any in here if you really dont need it