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

svelte-kit package requires there be an app.html file #2547

Closed
chanced opened this issue Oct 2, 2021 · 4 comments · Fixed by #3161
Closed

svelte-kit package requires there be an app.html file #2547

chanced opened this issue Oct 2, 2021 · 4 comments · Fixed by #3161
Labels
feature / enhancement New feature or request p3-edge-case SvelteKit cannot be used in an uncommon way

Comments

@chanced
Copy link

chanced commented Oct 2, 2021

Describe the bug

svelte-kit package requires there be an app.html file.

Reproduction

npm init svelte@next project-name
cd project-name
npm i && npm i -D svelte2tsx typescript
rm src/app.html
echo "import preprocess from 'svelte-preprocess'; \n/** @type {import('@sveltejs/kit').Config} */ \nconst config = { preprocess: preprocess() }; \nexport default config;" > svelte.config.js
npm exec svelte-kit package

Logs

▶ npm exec svelte-kit package
src/app.html does not exist
Error: src/app.html does not exist
    at validate_template (file:///Users/chance/Projects/spike/svelte-kit-without-apphtml/node_modules/@sveltejs/kit/dist/cli.js:688:9)
    at load_config (file:///Users/chance/Projects/spike/svelte-kit-without-apphtml/node_modules/@sveltejs/kit/dist/cli.js:708:2)
    at async get_config (file:///Users/chance/Projects/spike/svelte-kit-without-apphtml/node_modules/@sveltejs/kit/dist/cli.js:769:10)
    at async file:///Users/chance/Projects/spike/svelte-kit-without-apphtml/node_modules/@sveltejs/kit/dist/cli.js:924:18

System Info

System:
    OS: macOS 11.5.2
    CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
    Memory: 105.45 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.9.0 - ~/.nvm/versions/node/v16.9.0/bin/node
    npm: 7.21.1 - ~/.nvm/versions/node/v16.9.0/bin/npm
  Browsers:
    Brave Browser: 79.1.1.23
    Chrome: 94.0.4606.61
    Edge: 92.0.902.78
    Firefox: 91.0.2
    Safari: 14.1.2
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.179 
    svelte: ^3.42.6 => 3.43.1

Severity

annoyance

Additional Information

No response

@Conduitry
Copy link
Member

I suppose this could probably safely be made optional for svelte-kit package, but part of the idea here is that you would also run the app normally (svelte-kit dev/svelte-kit build) to produce a demonstration of the included components, and that would fail without a src/app.html, so I'm not sure we'd want to be encouraging that sort of setup.

@chanced
Copy link
Author

chanced commented Oct 2, 2021

Yea, I totally get that. I guess I could switch my template files, per package, to {package}.html and that'd solve my issue of having numerous erroneous app.html files in a monorepo.

@chanced chanced closed this as completed Oct 2, 2021
@martaver
Copy link

martaver commented Dec 7, 2021

I am using storybook to generate the docs and testbed for my component library. In this case, there's no point having an app.html.

Can we re-open this and consider making the app.html optional for the package command?

@chanced chanced reopened this Dec 7, 2021
@chanced
Copy link
Author

chanced commented Dec 7, 2021

@martaver reopened.

@Conduitry Conduitry added feature / enhancement New feature or request p3-edge-case SvelteKit cannot be used in an uncommon way labels Dec 7, 2021
@bluwy bluwy linked a pull request Dec 31, 2021 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature / enhancement New feature or request p3-edge-case SvelteKit cannot be used in an uncommon way
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants