svelte-adapter-bun icon indicating copy to clipboard operation
svelte-adapter-bun copied to clipboard

Error when running bun production server

Open peterlerche opened this issue 2 years ago • 0 comments

Hi,

I am unsure if I am barking up the wrong tree but I get the following error when running SvelteKit in production using Bun and your 3.1.0 svelte-adapter-bun on Linux.

bun build and bun preview works without any issues.

I get the error because the GET request cannot find /favicon.ico. However, there is no favicon.ico file in the project and no references to a favicon.ico within my SvelteKit project as I am using favicon.png.

bun run ./dist/index.js
Listening on 0.0.0.0:3000
2149 |         check_origin: true
2150 |       },
2151 |       dev: false,
2152 |       get_stack: (error2) => String(error2),
2153 |       handle_error: (error2, event) => {
2154 |         this.options.hooks.handleError({
            ^
TypeError: null is not an object (evaluating 'this.options.hooks.handleError')
      at /home/peterl/Projects/xxxx/dist/server/index.js:2154:8
      at handle_fatal_error (/home/peterl/Projects/xxxx/dist/server/index.js:217:4)
GET - http://0.0.0.0:3000/ failed
2149 |         check_origin: true
2150 |       },
2151 |       dev: false,
2152 |       get_stack: (error2) => String(error2),
2153 |       handle_error: (error2, event) => {
2154 |         this.options.hooks.handleError({
            ^
TypeError: null is not an object (evaluating 'this.options.hooks.handleError')
      at /home/peterl/Projects/xxxx/dist/server/index.js:2154:8
      at handle_fatal_error (/home/peterl/Projects/xxxx/dist/server/index.js:217:4)
GET - http://0.0.0.0:3000/favicon.ico failed

After adding a "/static/favicon.ico" file, I still get the following error.

bun run ./dist/index.js
Listening on 0.0.0.0:3000
2162 |         check_origin: true
2163 |       },
2164 |       dev: false,
2165 |       get_stack: (error2) => String(error2),
2166 |       handle_error: (error2, event) => {
2167 |         this.options.hooks.handleError({
            ^
TypeError: null is not an object (evaluating 'this.options.hooks.handleError')
      at /home/peterl/Projects/xxxx/dist/server/index.js:2167:8
      at handle_fatal_error (/home/peterl/Projects/xxxx/dist/server/index.js:217:4)
GET - http://0.0.0.0:3000/ failed

From svelte.config.js

adapter: adapter({



			// optional values see: https://github.com/gornostay25/svelte-adapter-bun
			out: "dist",
			assets: true,
			development: true,
			
			precompress: {
				brotli: true,
				gzip: true,
				files: ['html', 'js', 'json', 'css', 'svg', 'xml', 'wasm']
			},
			


		}),

Is this a svelte-adapter-bun issue, or should I look somewhere else?

Thank you for this project.

peterlerche avatar Sep 07 '22 10:09 peterlerche