当执行命令时:serverless deploy
,我得到以下错误
Running "serverless" from node_modules
Deploying my-project to stage dev (us-east-1)
Optimize: starting engines
Optimize: my-project-dev-main
× Stack onfield-api-v3-dev failed to deploy (12s)
Environment: win32, node 16.10.0, framework 3.30.1 (local) 3.30.1v (global), plugin 6.2.3, SDK 4.3.2
Credentials: Local, "default" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
'import' and 'export' may appear only with 'sourceType: module'
我对.eslintrc.js、serverless.yml和browserify中的配置选项进行了演练,只得到了更多的错误和死胡同
1条答案
按热度按时间r9f1avp51#
为了解决这个问题,我只能建议直接将
console.log()
错误添加到node_module
内部的serverless-optimize
插件中。在这里,您应该会看到类似这样的内容:然后,只需添加为您在serverless配置中优化*external**对象带来问题的包即可。