Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Invalid left-hand side in assignment #29582

Closed
randalpinto opened this issue Oct 3, 2021 · 1 comment
Closed

Invalid left-hand side in assignment #29582

randalpinto opened this issue Oct 3, 2021 · 1 comment
Labels
bug Issue was opened via the bug report template.

Comments

@randalpinto
Copy link

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

12.22.1

What browser are you using?

Chrome

What operating system are you using?

MacOS

How are you deploying your application?

Other platform

Describe the Bug

When packaging up my application for serverless deployment the following code:

https://github.com/vercel/next.js/blob/canary/packages/next/server/next-server.ts#L295

gets packaged up to:

true = JSON.stringify(true);

which results in the following exception at runtime:

"/var/task/chunks/602.js:429285",
        "            true = JSON.stringify(true);",
        "            ^^^^",
        "",
        "SyntaxError: Invalid left-hand side in assignment",
        "    at wrapSafe (internal/modules/cjs/loader.js:988:16)",
        "    at Module._compile (internal/modules/cjs/loader.js:1036:27)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)",
        "    at Module.load (internal/modules/cjs/loader.js:937:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:778:12)",
        "    at Module.require (internal/modules/cjs/loader.js:961:19)",
        "    at require (internal/modules/cjs/helpers.js:92:18)",
        "    at Object.__webpack_require__.f.require (/var/task/pages/api/test.js:495:28)",
        "    at /var/task/pages/api/test.js:418:40",
        "    at Array.reduce (<anonymous>)"

Expected Behavior

No exception

To Reproduce

I am deploying my app using: https://github.com/serverless-nextjs/serverless-next.js

A simple API route that returns 200 OK results in this error.

@randalpinto randalpinto added the bug Issue was opened via the bug report template. label Oct 3, 2021
@PatrickChoDev
Copy link

isn't true the JavaScript and TypeScript restricted words?
https://www.typescriptlang.org/docs/handbook/2/everyday-types.html

@vercel vercel locked and limited conversation to collaborators Oct 5, 2021
@ijjk ijjk closed this as completed Oct 5, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants