FredKSchott / snowpack

ESM-powered frontend build tool. Instant, lightweight, unbundled development. ✌️
https://www.snowpack.dev
MIT License
19.48k stars 922 forks source link

Streaming imports doesn't work for svelte #2268

Closed kjk closed 3 years ago

kjk commented 3 years ago

Using just released snowpack 3.0, I did:

npx create-snowpack-app svelte-test --template  @snowpack/app-template-svelte

I did yarn start to verify it works.

I then enabled streaming imports by adding:

  packageOptions: {
    source: "remote",
  },

to snowpack.config.js.

On yarn start I got the following error:

chrome_YbIbGJpX9J

kjk commented 3 years ago

Looks like issue with caching/serving cached files:

chrome_esenlsDWbo

chrome_pZTXkmSP0X

i.e. "internal" probably meant to be a JS file from pkg.snowpack.dev cached locally, but instead its content is what looks like an error message.

FredKSchott commented 3 years ago

Interesting, will take a look. That should be saved as svelte/internal.js, not svelte/internal so I'm curious why that's happening. It may be because of a redirect from one to the other that our cache isn't picking up.

FredKSchott commented 3 years ago

Found the issue, as expected it was a bad resolution on the CDN. Planning to push out a fix tonight

FredKSchott commented 3 years ago

Fixed! You may need to use the --reload flag to clear the bad import from your local cache.

jatbone commented 3 years ago

Hi! Unfortunately I am experiencing same problem. Event after I clear cache with ---reload.

$ snowpack build --reload
[24:35:05] [snowpack] ! clearing cache...
[24:35:05] [snowpack] ! building files...
[24:35:06] [@snowpack/plugin-typescript] Command completed.
[24:35:08] [snowpack] (/_snowpack/pkg/svelte/internal) Deprecated manual package import. Please use snowpack.getUrlForPackage() to create package URLs instead.
[24:35:08] [snowpack] import svelte@latest → https://pkg.snowpack.dev/svelte
[24:35:09] [snowpack] (/_snowpack/pkg/svelte) Deprecated manual package import. Please use snowpack.getUrlForPackage() to create package URLs instead.
[24:35:09] [snowpack] EISDIR: illegal operation on a directory, open '/TEST/snowpack/build/_snowpack/pkg/svelte'
[24:35:09] [snowpack] Error: EISDIR: illegal operation on a directory, open '/TEST/snowpack/build/_snowpack/pkg/svelte'
error Command failed with exit code 1.

Files are missing extension in pkg dir.

Thanks