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
We are currently trying to deploy this boilerplate on Windows Azure AppService. Thats basically NodeJs server wrapped into iisnode module(in essence it should function the same as nodejs/express server).
When using steps for deployment, locally it works fine. However, when deployed on Azure app service we are getting the following error: (function (exports, require, module, __filename, __dirname) { import Express from 'express' ^^^^^^ SyntaxError: Unexpected token import at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10)
For Azure deployment all that needs to be done is to configure web.config file which points to server.js file which should not be the cause of this issue. It seems that this is something to do with babel transpiler missing on deployment machine.
Any idea on how to solve this issue?
Thank you
The text was updated successfully, but these errors were encountered:
From the error message, it seems NodeJS tried to run ES6 without babel.
To run server side code without pre-built with babel (like in development), we should point the entry file to server/index.js, which require-s babel/register, instead of server/server.js.
Or, there's a task inside gulpfile building server side code with Babel. By running gulp build, it would build server side code under dist/server-build. After that we can point the entry file to the built one.
Theres some more issues when deploying on Azure, managed to solve them all now im improving procedure a bit. I'll write steps needed in case someone else tries to do the same.
Hi,
We are currently trying to deploy this boilerplate on Windows Azure AppService. Thats basically NodeJs server wrapped into iisnode module(in essence it should function the same as nodejs/express server).
When using steps for deployment, locally it works fine. However, when deployed on Azure app service we are getting the following error:
(function (exports, require, module, __filename, __dirname) { import Express from 'express' ^^^^^^ SyntaxError: Unexpected token import at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10)
For Azure deployment all that needs to be done is to configure web.config file which points to server.js file which should not be the cause of this issue. It seems that this is something to do with babel transpiler missing on deployment machine.
Any idea on how to solve this issue?
Thank you
The text was updated successfully, but these errors were encountered: