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

Importing .svelte files fails unless the request is modified #13

Closed
Rich-Harris opened this issue Sep 16, 2020 · 2 comments
Closed

Importing .svelte files fails unless the request is modified #13

Rich-Harris opened this issue Sep 16, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@Rich-Harris
Copy link
Member

A file that imports a Svelte component...

import App from './App.svelte';

...gets rewritten by Snowpack thusly:

import App from './App.svelte.js';

This import will fail, because Snowpack only wants to serve App.js. Needs a bit more investigation but at some point if I can make a minimal repro I'll raise an issue on the Snowpack issue tracker.

@FredKSchott
Copy link
Contributor

Yup, that's unexpected. You can see this working in our Svelte Create Snowpack App template: https://github.com/pikapkg/snowpack/blob/master/create-snowpack-app/app-template-svelte/src/index.js

Is @snowpack/plugin-svelte connected to your snowpack config? A quick GitHub search found it in your package dependencies, but no where else.

@Rich-Harris
Copy link
Member Author

As of 70f2dd14f90f57f9948afda8308ba691b1a50ad8, the Snowpack config lives in the app rather than in Sapper: https://github.com/sveltejs/snowpack-sapper-demo/blob/master/snowpack.config.json (this was impossible previously because there needed to be two separate Snowpack instances). Now quite sure what's going on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants