question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Things I see a lot on Discord

  • hmr questions - we should document the configuration
  • load fallthrough
  • vite aliases (also in jsconfig.json). can use this as a workaround to fix package imports. e.g. alias: { 'firebase/app': resolve('firebase/app/dist/index.cjs.js') }
  • packages not working with vite (try moving between dependencies and devDependencies as in https://github.com/sveltejs/kit/issues/655. or trying to include or exclude it in optimizeDeps)
  • adapter broken because using old version (https://github.com/sveltejs/kit/issues/686 would be a better solution than documenting however)
  • how do I use X with SvelteKit?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
rmunncommented, Apr 5, 2021

I feel like a quick guide to Vite’s dependency-related options would be a good thing to put in Svelte-Kit’s FAQ. The Vite documentation does contain what you need to know, but for a newbie it can feel a bit confusing. Why is there different behavior between dependencies and devDependencies? What does optimizeDeps do, anyway? And what will happen if I specify ssr.external vs ssr.noExternal? What’s this “externalizing” dependencies thing?

I’ve been doing Javascript for several years and I myself am not 100% clear on some of those questions, certainly not enough to be able to answer newbie questions. Someone new to Javascript is going to feel lost at sea with this stuff. Since Svelte-Kit comes configured with SSR out-of-the-box, I think something in the documentation should include a gentle guide to SSR, the difference between ESM and CJS modules, and what it all means, followed by some suggested troubleshooting steps if you run into the dreaded “require is not defined” error trying to import some NPM package. No need to go into too much detail since it’s going to be a document intended for newbies, and you don’t want to overwhelm them with too much information, but just something like “Javascript modules have two different formats, CJS that uses ‘require’ and ESM that uses ‘import’. We try to hide the difference from you and make things Just Work™ as much as possible, but you’ll occasionally run into trouble with NPM packages you’re trying to import. When you do, here are some steps to try.”

In other words, something like the “How do I fix the error I’m getting trying to include a package?” section in #877 but fleshed out a little more, with a couple sentences to explain the most basic of the concepts and a few different common scenarios: the error message you’ll see, the solution that works for that scenario.

0reactions
benmccanncommented, Apr 13, 2021

The FAQ content has been merged into this repo, but still needs to be published: https://github.com/sveltejs/sites/issues/19

Read more comments on GitHub >

github_iconTop Results From Across the Web

25 Best Examples Of Effective FAQ Pages
Frequently Asked Question (FAQ) pages (or informational hubs) enable your business to respond, react, and anticipate the needs of your audience ...
Read more >
FAQ - Wikipedia
A frequently asked questions (FAQ) list is often used in articles, websites, email lists, and online forums where common questions tend to recur, ......
Read more >
12 Crystal-Clear FAQ Page Examples & How to Make Your Own
Most companies have an FAQ — or Frequently Asked Questions — page on their website. This page includes a series of questions that...
Read more >
FAQ Definition & Meaning - Merriam-Webster
The meaning of FAQ is a document (as on a website) that provides answers to a list of typical questions that users might...
Read more >
FAQ – Privacy & Terms - Google's policies
How does Google protect my privacy and keep my information secure? We know security and privacy are important to you – and they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found