riot / ssr

Riot.js node Server Side Rendering
MIT License
32 stars 8 forks source link

"fs" error when building webpack #9

Closed cybervaldez closed 5 years ago

cybervaldez commented 5 years ago

I'm getting this error using any of the codes from the README;

ERROR in ./node_modules/@riotjs/compiler/node_modules/source-map/lib/read-wasm.js Module not found: Error: Can't resolve 'fs'

Any help is appreciated, i'm new to SSR so let me know if i'm understanding SSR correctly. Basically all what I want to do is precompile my tags to html and then inject it to my output html.

GianlucaGuarini commented 5 years ago

@cybervaldez you can't of course build @riotjs/ssr via webpack because it's a npm module needed for the server side rendering. If you want to compile your tags via webpack you need to use https://github.com/riot/webpack-loader and if you want to prerender your tags html you can use a simple node script without relying on webpack

cybervaldez commented 5 years ago

@GianlucaGuarini I ended up going with expressjs instead of webpack's dev server, I was hoping to build everything in webpack so I can enjoy HMR (webpack+webpack-dev-server+hmr+riotjs/ssr+riotjs/hydrate)