Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: invalid assignment left-hand side #3

Open
matheus-gc opened this issue Dec 9, 2022 · 2 comments
Open

SyntaxError: invalid assignment left-hand side #3

matheus-gc opened this issue Dec 9, 2022 · 2 comments

Comments

@matheus-gc
Copy link

matheus-gc commented Dec 9, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

The highlighted lines makes the app crash when building and bundling with webpack. This is the error I get when run the bundle.js SyntaxError: invalid assignment left-hand side You are reassigning the the env var, but the bundler does not understand that.

Thanks

Here is the diff that solved my problem:

diff --git a/node_modules/convert-lambda-to-express/dist/devServer.js b/node_modules/convert-lambda-to-express/dist/devServer.js
index 2a6fae2..3b67166 100644
--- a/node_modules/convert-lambda-to-express/dist/devServer.js
+++ b/node_modules/convert-lambda-to-express/dist/devServer.js
@@ -174,11 +174,10 @@ function getDevServer(config) {
 exports.getDevServer = getDevServer;
 function startDevServer(config = {}) {
     var _a, _b;
-    if (config.prod) {
-        process.env.NODE_ENV = 'production';
-    }
-    else if (process.env.NODE_ENV === 'production') {
+    if (process.env.NODE_ENV === 'production') {
         config.prod = true;
+    } else {
+        config.prod = false;
     }
     const port = (_a = config.port) !== null && _a !== void 0 ? _a : 3001;
     const hotReload = (_b = config.hotReload) !== null && _b !== void 0 ? _b : true;

This issue body was partially generated by patch-package.

@matthewkeil
Copy link
Owner

Hi there @matheus-gc! Sorry for the obscenely long response time. I didn’t see the notification when you wrote the issue above. I will take a look over the next few days if you are still running into this. I hope you are well and happy new year (10 months ago 😆)!!

@matheus-gc
Copy link
Author

Hi there @matheus-gc! Sorry for the obscenely long response time. I didn’t see the notification when you wrote the issue above. I will take a look over the next few days if you are still running into this. I hope you are well and happy new year (10 months ago 😆)!!

Thank you! yeah I still applying that patch to the package. We haven't migrated all lambdas to the respective services yet, so we still running them in prod with your library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants