FredKSchott / create-snowpack-app

The all-in-one app template for Snowpack. [moved]

Home Page:https://www.snowpack.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svelte: add svelte-preprocess as a dependency

rondonjon opened this issue Β· comments

PR #50 has added preprocessor support for svelte (which is great πŸ‘, thanks), but I struggled to get it to work, and the error message that I was getting honestly didn't help me too much:

  build:svelte............[ERROR] (plugin) @snowpack/plugin-svelte

β–Ό build:svelte

  Identifier is expected

I was able to solve the problem by installing svelte-preprocess manually.

If this should remain an optional dependency, I think it should be documented (or documented more prominently if it already is).

Since preprocessing is a pretty common thing in svelte, I would rather suggest to just add svelte-preprocess as a dependency directly though.

Thanks for filing! I'm surprised to hear that, i don't see anywhere in the docs a mention that you need svelte-preprocess installed for svelte.preprocess() to run. https://svelte.dev/docs#svelte_preprocess. We should definitely improve that error message, regardless.

Mind adding some steps for me to reproduce in the Svelte CSA app? What your svelte.config.js file looks like and any dependencies you installed on top of the base setup it should be enough to debug. Thanks!

Hi @FredKSchott, thanks for the superfast reponse πŸš€ πŸ‘ πŸ‘

Turned out that it was me who introduced this additional dependency with my very own svelte.config.js file πŸ™„ Sorry

const sveltePreprocess = require("svelte-preprocess");

module.exports = {
  preprocess: sveltePreprocess()
};

haha no worries! I figured this may have been the case :)

I'm still surprised you got "Identifier is expected" and not "svelte-preprocess" not found. Tracked it down to us swallowing the error, fixed in b22b1c3