sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

Transpilation error "Not implemented undefined" when enabling babel #593

Closed dritter closed 1 year ago

dritter commented 1 year ago

Hi there!

I tinkered around with code from https://youtu.be/zVfd4ou9qaw?t=1033 and stumbled upon a compilation error when enabling babel. This code works perfectly fine without babel.

Reproducer

  1. git clone https://github.com/dritter/sveltekit-babel-compile-error-reproducer
  2. cd sveltekit-babel-compile-error-reproducer
  3. npm i
  4. npm run dev -- --open

I copied the code from the video above into Counter.svelte. This line causes the Bug to surface.

The babel config is from the README.md.

Stacktraces

Stack trace [vite] Error when evaluating SSR module /src/routes/+page.svelte: failed to import "/src/routes/Counter.svelte" |- Error: Not implemented undefined at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6828:9) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7084:18 at Array.map () at handle_body (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7083:21) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7168:7 at scoped_fn (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7052:10) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7084:18 at Array.map () at handle_body (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7083:21) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7168:7 at scoped_fn (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7052:10) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at LabeledStatement (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7210:53) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7084:18 at Array.map () at handle_body (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7083:21) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7168:7 at scoped_fn (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7052:10) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7649:24 at scoped_fn (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7052:10) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:8077:44 at Array.map () at CallExpression (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:8077:31) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at VariableDeclarator (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7420:52) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7140:3 at Array.map () at handle_var_declaration (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7139:40) at VariableDeclaration (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7415:10) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7084:18 at Array.map () at handle_body (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7083:21) at Program (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:7162:10) at handle (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:6831:17) at print (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:8458:17) at Component.generate (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:42576:22) at compile (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/svelte/compiler.mjs:43792:22) at compileSvelte2 (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:573:22) at async TransformContext.transform (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:2335:25) at async Object.transform (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/vite/dist/node/chunks/dep-7efa13d7.js:42863:30) at async loadAndTransform (file:///home/dritter/Projekte/sveltekit-babel-compile-error-reproducer/node_modules/vite/dist/node/chunks/dep-7efa13d7.js:53342:29)

Information about your project

System: OS: Linux 6.2 Arch Linux CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz Memory: 2.70 GB / 15.39 GB Container: Yes Shell: 5.9 - /usr/bin/zsh Binaries: Node: 19.9.0 - /usr/bin/node npm: 8.19.2 - /usr/bin/npm Browsers: Chromium: 112.0.5615.165 Firefox: 112.0.2 npmPackages: @sveltejs/adapter-auto: ^2.0.0 => 2.0.1 @sveltejs/kit: ^1.5.0 => 1.15.8 svelte: ^3.54.0 => 3.58.0 vite: ^4.3.0 => 4.3.2

Conduitry commented 1 year ago

This is a duplicate of https://github.com/sveltejs/svelte/issues/6706