Sapper: Bad Developer Experience: hidden error stack during sapper export

Created on 7 Nov 2019  路  6Comments  路  Source: sveltejs/sapper

Describe the bug
i'm running sapper export for my blog, and suddenly started receiving this new error: "URL must be a string. Received undefined".

image

I have no idea where this error message comes from, and so no idea how to fix it. still trying to figure out how to repro but figured i would log this issue first.

To Reproduce

not sure yet. if i know i'll update this

Expected behavior
the error message tells me how to fix it.

Stacktraces
not yet

Information about your Sapper Installation:

  • Sapper version (Please check you can reproduce the issue with the latest release!)

0.27.9

  • Svelte version (Please check you can reproduce the issue with the latest release!)

3.12.1

  • If it is an exported (npm run export) or dynamic application.

export

  • Whether your application uses Webpack or Rollup

rollup

Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Sapper entirely?

blocking me only right now.

enhancement error handling export

Most helpful comment

I bet it's coming from here: https://github.com/sveltejs/sapper/blob/b1c4585c874fd156aaa36cc1d71abb6864faa279/src/cli.ts#L266

Otherwise you can try this trick: console.error = console.log = console.trace as the first line in your entry point.

All 6 comments

Could this be related to sveltejs/svelte#3846 and sveltejs/svelte#3862?

no, the only thing that #3846 or #3862 do differently is splitting (String.prototype.split) and encoding (encodeURI). Neither of those ever produce undefined.

Problem MUST be elsewhere :thinking:

whats really frustrating is i dont even know the source of the error message. no error stack, nothing in the export stack i can see logs out this error message specifically. such a terrible dx! i bet once we find the source of thus issue we鈥檒l be able to improve logging for lots of people not just me

I bet it's coming from here: https://github.com/sveltejs/sapper/blob/b1c4585c874fd156aaa36cc1d71abb6864faa279/src/cli.ts#L266

Otherwise you can try this trick: console.error = console.log = console.trace as the first line in your entry point.

@rixo that was exactly what i needed to do. it gave me the stack trace i needed to go identify and fix my problem:

image

@pngwn @Conduitry would you take a PR to log out the stack trace for these errors? i strongly believe we should not swallow the stack trace. just error messages alone aren't enough. just need to agree on how to log this prettily if you care about that sort of thing.

@sw-yx sorry, just seen this.

I agree we should not be swallowing the stack trace here. We definitely need to show that when something goes wrong like in this case.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Snugug picture Snugug  路  4Comments

mylastore picture mylastore  路  3Comments

jhuettinger picture jhuettinger  路  3Comments

SARFEX picture SARFEX  路  3Comments

keyvan-m-sadeghi picture keyvan-m-sadeghi  路  4Comments