-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Describe the bug
For some reason, one particular type based on SvelteComponentTyped
seems to be being type-erasured incorrectly in the dev server on hot reloads. This is way easier to see than to explain, so just follow the repro steps below (I was able to get two people reproducing it in the Discord pretty quickly).
To Reproduce
- Clone my repository.
- Check out the
this-does-not-work
branch. - Run the dev server (
yarn dev
) - Make any change to
routes/index.svelte
that triggers a hot reload. - Profit by seeing the error:
SyntaxError: The requested module '/src/lib/Notifications/types.ts' does not provide an export named 'CustomNotificationComponent'
You can also diff the this-works
branch with the this-does-not-work
branch to see the workaround that, for some super weird reason, makes everything work fine.
Expected behavior
No 500 error :)
System:
OS: Linux 5.8 Pop!_OS 20.04 LTS
CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
Memory: 12.36 GB / 31.37 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.16.1 - ~/.nvm/versions/node/v14.16.1/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.16.1/bin/yarn
npm: 7.15.0 - ~/.nvm/versions/node/v14.16.1/bin/npm
Browsers:
Chromium: 83.0.4103.116
Firefox: 89.0.1
npmPackages:
@sveltejs/adapter-node: next => 1.0.0-next.27
@sveltejs/kit: next => 1.0.0-next.116
svelte: ^3.34.0 => 3.38.3
Severity
Major annoyance because I can't export my types from one file :)
Metadata
Metadata
Assignees
Labels
No labels