bug: a given Svelte example does not compile
See original GitHub issueTrying to run Svelte example project I got:
ERROR in ./node_modules/@vime/svelte/src/lib.ts 1:30
Module parse failed: Unexpected token (1:30)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> export const define = (tagName: string, clazz: any) => {
| const isClient = typeof window !== 'undefined';
| if (isClient && !customElements.get(tagName))
@ ./node_modules/@vime/svelte/src/svelte/Audio.svelte 17:0-32 20:0-33 102:0-6 103:0-6
@ ./node_modules/@vime/svelte/src/svelte/index.js
@ ./node_modules/@vime/svelte/src/svelte.js
@ ./src/App.svelte
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/@vime/core/dist/custom-elements/index.js 20:15
Module parse failed: Unexpected token (20:15)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| timeout = setTimeout(() => {
| if (attempt === maxRetries) {
> onFail?.();
| return;
| }
@ ./node_modules/@vime/svelte/src/svelte.js 2:0-27 2:0-27
@ ./src/App.svelte
@ ./src/main.ts
@ multi ./src/main.ts
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Fixing a bug in Svelte, from issue to pull request - YouTube
I found an obscure bug in Svelte, and thought I'd try to fix it live on Twitch. And I did! ... Your browser...
Read more >How do I fix this random bug in svelte
I think you need to import it like import type { SidebarInfo } from "../static/sidebar" // Sidebar.ts export type SidebarInfo = {}.
Read more >Contributing to Svelte - Fixing issue #4392
Of course, contributing to Svelte, does not mean to contribute only in code, ... I was combing through bugs on GitHub, and found...
Read more >Why Svelte is the Next Big Thing in JavaScript Development
Svelte, however, doesn't use a virtual DOM, instead compiling code into tiny, pure Vanilla JS. As a result, the code works much faster...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I don’t have that error, but this one:
I use CRA, so I have no idea which version of webpack I use, but I have the following in package.json
And node 14.17.0
This answer solved the problem: https://stackoverflow.com/questions/67551922/cra-react-leaflet-failed-to-compile
Open your package.json file
Replace it with following lines :
Now Delete node_modeules folder
npm install
npm start