FredKSchott / snowpack

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

[BUG] Snowpack throws `NotFoundError` when editing a file in VSCode #3239

Open heokhe opened 3 years ago

heokhe commented 3 years ago

Bug Report Quick Checklist

Describe the bug

After editing a file with VSCode and saving it, the following is printed in the terminal screen and the app doesn't refresh:

[12:52:15] [snowpack] File changed: src/App.jsx (x15)
[12:52:15] [snowpack] [class NotFoundError extends Error]
[12:52:15] [snowpack] class NotFoundError extends Error {
    constructor(url, lookups) {
        if (!lookups) {
            super(`Not Found (${url})`);
        }
        else {
            super(`Not Found (${url}):\n${lookups.map((loc) => '  ✘ ' + loc).join('\n')}`);
        }
    }
}
[12:52:15] [snowpack] [500] /dist/App.js?mtime=1619767275192

To Reproduce

  1. npm init snowpack-app --template @snowpack/app-template-preact
  2. npm start
  3. Edit a file with VSCode and save it
  4. Repeat until you see the error

Anything else?

I tested nano and everything was fine and I'm not sure if this is a problem with Snowpack or VSCode or anything else, so feel free to close this issue if I'm wrong.

aaronanderson commented 3 years ago

I encountered the same thing and reverting from 3.5.7 back down to 3.5.5 fixed the issue.

The 3.5.7 version didn't like the export * from './World'; line in my index.ts file where the World.ts file only contained a Typescript interface:

export interface World {
    name: string;
    time: Time;
}
mylastore commented 3 years ago

Work around add this at the bottom of the file const _SNOWPACK = true I am using typescript 4.2.4 and still get that error so typescript versions is not really the problem