next-compute-js icon indicating copy to clipboard operation
next-compute-js copied to clipboard

Errors with Next 13

Open twhid opened this issue 2 years ago • 0 comments

Hi,

It doesn't appear that the current code/getting started works any longer. Following the instructions in the readme and running fastly compute serve but the code doesn't build. These seem to be the relevant errors:

✘ [ERROR] Transforming destructuring to the configured target environment ("es5") is not supported yet

    bin/index.js:2:1280309:
      2 │ ...default.Component{render(){const{statusCode:e,withDarkMode:t=!0}...
        ╵                                    ^

  The target environment was set to "es5" here:

    ../tsconfig.json:3:14:
      3 │     "target": "es5",
        ╵               ~~~~~

/Users/timwhidden/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:157
      throw new Error("Invalid packet");
      ^

Error: Invalid packet
    at ByteBuffer._read (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:157:13)
    at ByteBuffer.read (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:171:20)
    at visit (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:94:30)
    at visit (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:109:43)
    at visit (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:109:43)
    at visit (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:101:23)
    at visit (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:109:43)
    at decodePacket (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:121:15)
    at handleIncomingPacket (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:726:18)
    at Socket.readFromStdout (/Users/projects/next-js-compute/compute-js/node_modules/esbuild/lib/main.js:656:7)

There are very, very many tsconfig errors and then the last error is the Invalid packet error before the fastly compute serve command exits.

Seems weird because I assume the next build would transform the TS to JS so it's unclear to me why the fastly compute build would be doing anything with TS.. or perhaps whatever is transforming the destructuring is just pointing out that the TS target is off. The tsconfig was generated by create-next-app.

twhid avatar Jan 11 '23 16:01 twhid