sid88in / serverless-appsync-plugin

serverless plugin for appsync
MIT License
951 stars 189 forks source link

Error: Cannot find module 'serverless/lib/serverless-error' after Serverless published version 4.0.23 #632

Open kumaresdev opened 6 months ago

kumaresdev commented 6 months ago

The serverless-appsync-plugin package.json has the following peer dependencies. Serverless has published version 4.0.23, which caused the AppSync deployment to fail.

  "peerDependencies": {
    "serverless": ">=3.0.0"
  }

ERROR:

Error: Cannot find module 'serverless/lib/serverless-error'
Require stack:
- /node_modules/serverless-appsync-plugin/lib/resources/Schema.js
- /node_modules/serverless-appsync-plugin/lib/resources/Api.js
- /node_modules/serverless-appsync-plugin/lib/index.js
- /usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js
- /usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js
- /usr/local/lib/node_modules/serverless/lib/serverless.js
- /usr/local/lib/node_modules/serverless/scripts/serverless.js
- /usr/local/lib/node_modules/serverless/bin/serverless.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/node_modules/serverless-appsync-plugin/lib/resources/Schema.js:12:42)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/node_modules/serverless-appsync-plugin/lib/resources/Api.js:31:16)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/node_modules/serverless-appsync-plugin/lib/index.js:52:13)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at module.exports (/usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js:5:12)
    at PluginManager.requireServicePlugin (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:171:14)
    at PluginManager.resolveServicePlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:198:29)
    at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:136:47)
    at Serverless.init (/usr/local/lib/node_modules/serverless/lib/serverless.js:146:30)
    at async /usr/local/lib/node_modules/serverless/scripts/serverless.js:614:7
gilada-shubham commented 5 months ago

Despite reverting to serverless version 3.38.0, I am still encountering the same issue.


To ensure safe major version upgrades ensure "frameworkVersion" setting in service configuration (recommended setup: "frameworkVersion: ^3.38.0")

Environment: linux, node 20.13.1, framework 3.38.0, plugin 7.2.3, SDK 4.5.1
Error:
Error: Cannot find module 'serverless/lib/serverless-error'
Require stack:
- /home/runner/work/smart-contact-center-backend/smart-contact-center-backend/scc-real-time-transcript/node_modules/serverless-appsync-plugin/lib/resources/Schema.js
- /home/runner/work/smart-contact-center-backend/smart-contact-center-backend/scc-real-time-transcript/node_modules/serverless-appsync-plugin/lib/resources/Api.js
- /home/runner/work/smart-contact-center-backend/smart-contact-center-backend/scc-real-time-transcript/node_modules/serverless-appsync-plugin/lib/index.js
- /opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js
- /opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/classes/plugin-manager.js
- /opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/serverless.js
- /opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/scripts/serverless.js
- /opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/bin/serverless.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/runner/work/smart-contact-center-backend/smart-contact-center-backend/scc-real-time-transcript/node_modules/serverless-appsync-plugin/lib/resources/Schema.js:12:42)
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1[41](https://github.com/RozieAI/smart-contact-center-backend/actions/runs/9301328959/job/25599244784#step:8:42)6:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/runner/work/smart-contact-center-backend/smart-contact-center-backend/scc-real-time-transcript/node_modules/serverless-appsync-plugin/lib/resources/Api.js:31:16)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/runner/work/smart-contact-center-backend/smart-contact-center-backend/scc-real-time-transcript/node_modules/serverless-appsync-plugin/lib/index.js:52:13)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at module.exports (/opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js:5:12)
    at PluginManager.requireServicePlugin (/opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/classes/plugin-manager.js:171:14)
    at PluginManager.resolveServicePlugins (/opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/classes/plugin-manager.js:198:29)
    at PluginManager.loadAllPlugins (/opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/classes/plugin-manager.js:136:47)
    at Serverless.init (/opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/lib/serverless.js:1[46](https://github.com/RozieAI/smart-contact-center-backend/actions/runs/9301328959/job/25599244784#step:8:47):30)
    at async /opt/hostedtoolcache/node/20.13.1/x64/lib/node_modules/serverless/scripts/serverless.js:601:7
Error: Process completed with exit code 1.
jessica-busatto commented 5 months ago

Same issue here

Environment: linux, node 18.19.1, framework 3.38.0, plugin 7.2.3, SDK 4.5.1
Error
84 | Error: Cannot find module 'serverless/lib/serverless-error'
85 | Require stack:
86 | - /codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Schema.js
87 | - /codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Api.js
88 | - /codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/index.js
89 | - /usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js
90 | - /usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js
91 | - /usr/local/lib/node_modules/serverless/lib/serverless.js
92 | - /usr/local/lib/node_modules/serverless/scripts/serverless.js
93 | - /usr/local/lib/node_modules/serverless/bin/serverless.js
94 | at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
95 | at Module._load (node:internal/modules/cjs/loader:975:27)
96 | at Module.require (node:internal/modules/cjs/loader:1225:19)
97 | at require (node:internal/modules/helpers:177:18)
98 | at Object.<anonymous> (/codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Schema.js:12:42)
99 | at Module._compile (node:internal/modules/cjs/loader:1356:14)
100 | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
101 | at Module.load (node:internal/modules/cjs/loader:1197:32)
102 | at Module._load (node:internal/modules/cjs/loader:1013:12)
103 | at Module.require (node:internal/modules/cjs/loader:1225:19)
104 | at require (node:internal/modules/helpers:177:18)
105 | at Object.<anonymous> (/codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Api.js:31:16)
106 | at Module._compile (node:internal/modules/cjs/loader:1356:14)
107 | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
108 | at Module.load (node:internal/modules/cjs/loader:1197:32)
109 | at Module._load (node:internal/modules/cjs/loader:1013:12)
110 | at Module.require (node:internal/modules/cjs/loader:1225:19)
111 | at require (node:internal/modules/helpers:177:18)
112 | at Object.<anonymous> (/codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/index.js:52:13)
113 | at Module._compile (node:internal/modules/cjs/loader:1356:14)
114 | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
115 | at Module.load (node:internal/modules/cjs/loader:1197:32)
116 | at Module._load (node:internal/modules/cjs/loader:1013:12)
117 | at Module.require (node:internal/modules/cjs/loader:1225:19)
118 | at require (node:internal/modules/helpers:177:18)
119 | at module.exports (/usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js:5:12)
120 | at PluginManager.requireServicePlugin (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:171:14)
121 | at PluginManager.resolveServicePlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:198:29)
122 | at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:136:47)
123 | at Serverless.init (/usr/local/lib/node_modules/serverless/lib/serverless.js:146:30)
124 | at async /usr/local/lib/node_modules/serverless/scripts/serverless.js:601:7
nonso-caleb commented 4 months ago

Same issue. Any fix or workaround for this?? I seem to be stuck

Same issue here

Environment: linux, node 18.19.1, framework 3.38.0, plugin 7.2.3, SDK 4.5.1
Error
84 | Error: Cannot find module 'serverless/lib/serverless-error'
85 | Require stack:
86 | - /codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Schema.js
87 | - /codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Api.js
88 | - /codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/index.js
89 | - /usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js
90 | - /usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js
91 | - /usr/local/lib/node_modules/serverless/lib/serverless.js
92 | - /usr/local/lib/node_modules/serverless/scripts/serverless.js
93 | - /usr/local/lib/node_modules/serverless/bin/serverless.js
94 | at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
95 | at Module._load (node:internal/modules/cjs/loader:975:27)
96 | at Module.require (node:internal/modules/cjs/loader:1225:19)
97 | at require (node:internal/modules/helpers:177:18)
98 | at Object.<anonymous> (/codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Schema.js:12:42)
99 | at Module._compile (node:internal/modules/cjs/loader:1356:14)
100 | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
101 | at Module.load (node:internal/modules/cjs/loader:1197:32)
102 | at Module._load (node:internal/modules/cjs/loader:1013:12)
103 | at Module.require (node:internal/modules/cjs/loader:1225:19)
104 | at require (node:internal/modules/helpers:177:18)
105 | at Object.<anonymous> (/codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/resources/Api.js:31:16)
106 | at Module._compile (node:internal/modules/cjs/loader:1356:14)
107 | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
108 | at Module.load (node:internal/modules/cjs/loader:1197:32)
109 | at Module._load (node:internal/modules/cjs/loader:1013:12)
110 | at Module.require (node:internal/modules/cjs/loader:1225:19)
111 | at require (node:internal/modules/helpers:177:18)
112 | at Object.<anonymous> (/codebuild/output/src1019297537/src/code/cmd/appsync/node_modules/serverless-appsync-plugin/lib/index.js:52:13)
113 | at Module._compile (node:internal/modules/cjs/loader:1356:14)
114 | at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
115 | at Module.load (node:internal/modules/cjs/loader:1197:32)
116 | at Module._load (node:internal/modules/cjs/loader:1013:12)
117 | at Module.require (node:internal/modules/cjs/loader:1225:19)
118 | at require (node:internal/modules/helpers:177:18)
119 | at module.exports (/usr/local/lib/node_modules/serverless/lib/utils/require-with-import-fallback.js:5:12)
120 | at PluginManager.requireServicePlugin (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:171:14)
121 | at PluginManager.resolveServicePlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:198:29)
122 | at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/plugin-manager.js:136:47)
123 | at Serverless.init (/usr/local/lib/node_modules/serverless/lib/serverless.js:146:30)
124 | at async /usr/local/lib/node_modules/serverless/scripts/serverless.js:601:7
kuda1992 commented 3 months ago

Is this ever going to get released? I see a commit with a fix.