yarbsemaj / sveltekit-adapter-lambda

An adapter to build a SvelteKit app into a lambda ready for deployment with lambda proxy via the Serverless Framework or CDK.
https://www.npmjs.com/package/@yarbsemaj/adapter-lambda
MIT License
77 stars 16 forks source link

Failure to build #25

Closed dnsbty closed 1 year ago

dnsbty commented 1 year ago

Thanks for the adapter. Unfortunately it's not working for me right now. I'm not sure what information to provide as I'm still new to SvelteKit, but I'm running Node v18.13.0 and whenever I run npm run build with this set up as described in the readme, I get the following error:

> Using adapter-serverless
 > node_modules/undici/lib/websocket/connection.js:5:35: error: Could not resolve "diagnostics_channel" (mark it as external to exclude it from the bundle)
    5 │ const diagnosticsChannel = require('diagnostics_channel')
      ╵                                    ~~~~~~~~~~~~~~~~~~~~~

 > node_modules/undici/lib/websocket/receiver.js:4:35: error: Could not resolve "diagnostics_channel" (mark it as external to exclude it from the bundle)
    4 │ const diagnosticsChannel = require('diagnostics_channel')
      ╵                                    ~~~~~~~~~~~~~~~~~~~~~

error during build:
Error: Build failed with 2 errors:
node_modules/undici/lib/websocket/connection.js:5:35: error: Could not resolve "diagnostics_channel" (mark it as external to exclude it from the bundle)
node_modules/undici/lib/websocket/receiver.js:4:35: error: Could not resolve "diagnostics_channel" (mark it as external to exclude it from the bundle)
    at failureErrorWithLog (node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:1275:15)
    at buildResponseToResult (node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:964:32)
    at node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:1057:20
    at node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:576:9
    at handleIncomingPacket (node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:665:9)
    at readFromStdout (node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:543:7)
    at runServiceSync (node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:1591:3)
    at Object.buildSync (node_modules/@yarbsemaj/adapter-lambda/node_modules/esbuild/lib/main.js:1407:3)
    at adapt (node_modules/@yarbsemaj/adapter-lambda/index.js:49:15)
    at adapt (node_modules/@sveltejs/kit/src/core/adapt/index.js:28:8)

I'm happy to help fix this in any way I can

yarbsemaj commented 1 year ago

Hi @dnsbty thank you for your interest in my project, I’ll investigate the issue and get back to you.

yarbsemaj commented 1 year ago

Hi @dnsbty I was able to replicate your issue on the latest version of sveltekit, and have published a fix under tag 1.0.0. If you have any further issue please let me know. Happy Deving James