sveltejs / svelte-loader

Webpack loader for svelte components.
MIT License
594 stars 73 forks source link

Error: "render is not a function" #191

Closed PierBover closed 3 years ago

PierBover commented 3 years ago

I'm trying to render a component to string via SSR, but when trying to use the render() method I'm always getting this error:

render is not a function

Here's a simple repro: https://github.com/PierBover/svelte-ssr-webpack-test

Just do

npm i
npm run start

I'm not sure if the issue is actually in svelte-loader but I figured I'd first report this here in case I've messed up something with Webpack.

PierBover commented 3 years ago

It's definitely an issue with svelte-loader and it was introduced with 3.0.0.

When using "svelte-loader": "^2.13.6" everything works as expected, even when using the latest Svelte version.

PierBover commented 3 years ago

Ok... the problem was that there was a breaking change in 3.0.0 and the compiler options now must be specified into an new compilerOptions object.