serverless-plugin-typescript
serverless-plugin-typescript copied to clipboard
on Azure.
When I deployed the example in the example directory, I get the following error:
`❯ sls deploy
Serverless: Compiling with Typescript...
handler.ts (3,42): Cannot find name 'setTimeout'.
Serverless: Packaging service...
Serverless: Logging in to Azure
Serverless: Looking for deployed functions that are not part of the current deployment...
Serverless: Creating resource group:
Error --------------------------------------------------
ENOENT: no such file or directory, stat '/Users/nipol/Project/<project name>/handler.js'
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Forums: forum.serverless.com Chat: gitter.im/serverless/serverless
Your Environment Information ----------------------------- OS: darwin Node Version: 6.10.0 Serverless Version: 1.11.0 ` The handler.ts file is not converted to handler.js. Where should I approach that plugin?
@pmuens do you have any idea what might be the issue here? We've just tested this on AWS.
Hmm. 🤔 hard to tell without a stack trace.
@Nipol could you run the command again after setting the SLS_DEBUG=*
environment variable? Thanks!
Error: ENOENT: no such file or directory, stat '/Users/nipol/Project/projectname/handler.js'
at Error (native)
at Object.fs.statSync (fs.js:1000:11)
at Object.statSync (/Users/nipol/Project/projectname/node_modules/graceful-fs/polyfills.js:297:22)
at Object.copySync (/Users/nipol/Project/projectname/node_modules/fs-extra/lib/copy-sync/copy-sync.js:31:86)
at BbPromise (/Users/nipol/Project/projectname/node_modules/serverless-azure-functions/provider/azureProvider.js:636:11)
at AzureProvider.createZipObjectAndUploadFunction (/Users/nipol/Project/projectname/node_modules/serverless-azure-functions/provider/azureProvider.js:624:8)
at serverless.service.getAllFunctions.forEach (/Users/nipol/Project/projectname/node_modules/serverless-azure-functions/deploy/lib/createFunctions.js:15:49)
at Array.forEach (native)
at AzureDeploy.createFunctions (/Users/nipol/Project/projectname/node_modules/serverless-azure-functions/deploy/lib/createFunctions.js:12:47)
at runCallback (timers.js:666:20)
at tryOnImmediate (timers.js:639:5)
From previous event:
at PluginManager.invoke (/Users/nipol/.nvm/versions/node/v6.10.2/lib/node_modules/serverless/lib/classes/PluginManager.js:210:22)
at PluginManager.run (/Users/nipol/.nvm/versions/node/v6.10.2/lib/node_modules/serverless/lib/classes/PluginManager.js:225:17)
at Serverless.run (/Users/nipol/.nvm/versions/node/v6.10.2/lib/node_modules/serverless/lib/Serverless.js:97:31)
at serverless.init.then (/Users/nipol/.nvm/versions/node/v6.10.2/lib/node_modules/serverless/bin/serverless:23:50)
Wow 😵 This is a burden to me. In addition to explaining the situation. The ".build" folder is created and then removed. There is a Transpiled javascript file in the zip of the ".serverless" folder. Please let me know if I can help you. @pmuens
@Nipol thanks for the detailed information 👍
Just looked into the code of the plugin here. Nothing suspicious so far.
It looks like the Azure functions provider plugin tries to access the file but is not able to do so.
I would recommend to open up an issue in the Azure Functions provider plugin (https://github.com/serverless/serverless-azure-functions/issues).
Since the transpilation step which this plugin does works just fine.
Just a quick note. The Azure functions plugin seems to be looking for a handler.js
file. Could it be that you have a handler.ts
file after transpiling with this plugin? That could be the root cause for this bug.
I see. 🤔
I need to check the azure plugin team and its issues, make sure that they are different from the AWS plugin, and make adjustments.
In addition, handler.ts
in the file location handler.js
in the same folder seems to recognize. However, the behavior of the plugin is to delete the Transpiled file after it has been put into the .build folder and bundled with the zip file.
But looking for the handler.js
file again is not a fundamental problem with this plugin.
@Nipol could you the try same command with the latest version v1.0.0
.
It should work now.
Thanks
This is still broken in v1.1.2