live_vue icon indicating copy to clipboard operation
live_vue copied to clipboard

SSR error - Cannot find module './vue/server.mjs'

Open Valian opened this issue 1 year ago • 1 comments

Reproduction

Ensure you run mix assets.build before and there's a file in priv/vue/server.mjs. Then, set ssr_module: LiveVue.SSR.NodeJS in your config and try visiting a page with server-side rendered component.

Explanation

It's related to the upstream package nodejs not supporting importing ESM modules. I've added support for it, waiting for maintainers to merge and release the new version.

You can track PR here: https://github.com/revelrylabs/elixir-nodejs/pull/84

Workaround

Add in your mix.exs deps:

{:nodejs, github: "Valian/elixir-nodejs", branch: "master", override: true}

Valian avatar May 16 '24 11:05 Valian

Update - there was some activity in the nodejs repo. My PR was rebased and ready to be merged. Hopefully soon ❤️

Valian avatar May 26 '24 21:05 Valian

It's done! Everything should be working smoothly with nodejs ~> 3.1 🎉

Valian avatar May 29 '24 08:05 Valian

Could you please update dependency version? It still points to the ~> 2.0.

vheathen avatar Jun 07 '24 18:06 vheathen

Ouch, sure! I'll do it in a moment

Valian avatar Jun 07 '24 18:06 Valian

@vheathen 0.3.9 has been published with corrected dependency ❤️

Valian avatar Jun 07 '24 21:06 Valian

@Valian thanks a lot!

vheathen avatar Jun 08 '24 07:06 vheathen