Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention common error messages in package FAQ #1009

Closed
wants to merge 2 commits into from

Conversation

danawoodman
Copy link
Contributor

@danawoodman danawoodman commented Apr 14, 2021

People are missing this FAQ because of the lack of a searchable error message so I've added them and structured the solutions to be easier to read.

People are missing this FAQ because of the lack of a searchable error message so I've add them and structured the solutions to be easier to read
Most of these issues come from Vite trying to deal with non-ESM libraries. You may find helpful examples in [the Vite issue tracker](https://github.com/vitejs/vite/issues). The most common solutions would be to try moving the package between `dependencies` and `devDependencies` or trying to `include` or `exclude` it in `optimizeDeps`. Packages which use `exports` instead of `module.exports` are currently failing due to a [known Vite issue](https://github.com/vitejs/vite/issues/2579). You should also consider asking the library author to distribute an ESM version of their package or even converting the source for the package entirely to ESM.
If youre seeing errors like:

* `[vite] Error when evaluating SSR module /node_modules/....`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we add error messages we should try to match them with the appropriate solution. I'm not actually sure how you fix this error and whether any of the solutions below work for it

Also, I'd remove the /node_modules/.... because you get C:\ on Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I've seen this is the error fixed by moving to devDependencies, are you saying co-locate those two?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this should be done since a few of the solutions would work for these errors, hence why I put them at the top.

What other errors are people seeing that I should put in here and how would you co-locate the errors when multiple solutions could solve the issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I'm pretty hesitant about this PR to be honest because I don't think we have a great understanding of the error messages and solutions, etc. I think most of the error messages can be found in the issue tracker and I've been pointing people to https://kit.svelte.dev/faq in those issues, so I think that this FAQ should already be fairly discoverable from the error message. Really I'd probably rather spend time trying to get #1016 in than improving the docs around this so that people don't hit as many of these issues in the first place and so that they're less complicated when they are encountered

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree fixing the underlying issue is superior to docs about the behavior, was just trying to help people out until the fix 🤷

@benmccann
Copy link
Member

I just rewrote this section of the docs in #1017

@benmccann benmccann added the documentation Improvements or additions to documentation label Apr 14, 2021
@danawoodman
Copy link
Contributor Author

@benmccann should I update this PR or kill it, I'm not clear which direction I should go

@benmccann
Copy link
Member

Maybe let's just kill this one. Hopefully the other PR and issue I created last night for this stuff will help and we can just fix this issue soon enough we don't have to worry about it too much. Thanks again for all your help

@benmccann benmccann closed this Apr 14, 2021
@danawoodman
Copy link
Contributor Author

That would be great! No worries, just trying to make people suffer a bit less getting setup :)

@danawoodman danawoodman deleted the patch-3 branch April 14, 2021 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants