Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Bad Developer Experience: hidden error stack during sapper export #982

Open
swyxio opened this issue Nov 7, 2019 · 6 comments
Open

Bad Developer Experience: hidden error stack during sapper export #982

swyxio opened this issue Nov 7, 2019 · 6 comments

Comments

@swyxio
Copy link

swyxio commented Nov 7, 2019

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.

@mustafa0x
Copy link

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

@vilarfg
Copy link

vilarfg commented Nov 7, 2019

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 🤔

@swyxio
Copy link
Author

swyxio commented Nov 7, 2019

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’ll be able to improve logging for lots of people not just me

@rixo
Copy link
Contributor

rixo commented Nov 7, 2019

I bet it's coming from here:

console.error(colors.bold().red(`> ${err.message}`));

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

@swyxio swyxio changed the title "URL must be a string. Received undefined" during static export Bad Developer Experience: hidden error stack during sapper export Nov 7, 2019
@swyxio
Copy link
Author

swyxio commented Nov 7, 2019

@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.

@pngwn
Copy link
Member

pngwn commented Nov 18, 2019

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants