sveltejs / svelte-loader

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

Error: Module parse failed: Unexpected token #143

Closed vaheqelyan closed 3 years ago

vaheqelyan commented 3 years ago

I used this template https://github.com/sveltejs/template-webpack provided by svelte After installing svelte-grid webpack logs error image

image don't know what could be wrong with this line

https://github.com/vaheqelyan/svelte-grid/blob/master/src/index.svelte#L107

REPO https://github.com/vaheqelyan/svelte-grid-webpack-template

dimfeld commented 3 years ago

You’ll need to set up Babel through babel-loader I think, or use Webpack 5. IIRC Webpack 4 doesn’t support the ?. syntax.

vaheqelyan commented 3 years ago

did so, unfortunately.. image https://github.com/sveltejs/svelte-loader/issues/137#issuecomment-706750871 solving the issue for me

vaheqelyan commented 3 years ago

closing this. the error is not related to svelte-loader