You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to 1.26.0 I kept getting the error Unable to import module 'serverless': Error at require (internal/module.js:20:19).
After looking at the deployed code it looks like my serverless.js module is no longer being included in the source uploaded to lambda. I assume this is due to this change: #4590. Renaming our entry module to a name other than serverless.js fixes the problem.
If serverless.js is now a reserved name used for configuration files, it would be good to have some sort of warning when using it like this!
Additional Data
Serverless Framework Version you're using:
1.26.0
Operating System:
macOS / alpine linux
Stack Trace:
Provider Error messages:
The text was updated successfully, but these errors were encountered:
Hi @andrewspinks , thanks for reporting this. Imo it is a bug, because the serverless.js must only be evaluated and handled, if there is no serverless.yml nor a serverless.json available for the service configuration.
Otherwise it has to be treated as user code. We should not restrict users with their names of their handler files.
This is a Bug Report
Description
My serverless definition uses a module called
serverless
as in the following configuration.After upgrading to 1.26.0 I kept getting the error
Unable to import module 'serverless': Error at require (internal/module.js:20:19)
.After looking at the deployed code it looks like my serverless.js module is no longer being included in the source uploaded to lambda. I assume this is due to this change: #4590. Renaming our entry module to a name other than serverless.js fixes the problem.
If
serverless.js
is now a reserved name used for configuration files, it would be good to have some sort of warning when using it like this!Additional Data
1.26.0
macOS / alpine linux
The text was updated successfully, but these errors were encountered: