__vite_ssr_import_0__.template is not a function when using vite-plugin-ssr and solid

See original GitHub issue

Repro:

import IconAccountBox from '~icons/mdi/account-box'
  • npm run dev
7:41:10 AM [vite] Error when evaluating SSR module ~icons/mdi/account-box:
TypeError: __vite_ssr_import_0__.template is not a function
    at ~icons/mdi/account-box:4:23
    at async instantiateModule 

@jfgodoy , do you know what could cause this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jfgodoycommented, Oct 10, 2021

hi @dephiros, the current implementation doesn’t support ssr. The good news is that I think I figured out how to achieve it. I will send a PR soon

1reaction
jcebcommented, Oct 15, 2021

Adding svg.replace(/([{}])/ig, "{'$1'}") before the props injecting works for me but it’s a blunt method that might not work in all cases. @jfgodoy @dephiros what do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Vite
Vite cannot handle and does not support code that only runs on non-strict mode (sloppy mode). This is because Vite uses ESM and...
Read more >
Vite/Vue3 throws Internal server error (experimental syntax ...
I use SFC in Vue and vue-class-component and vue-property-decorator for my components. I have updated: vite: 2.6.14 -> 2.9.12 @vitejs/ ...
Read more >
vite-plugin-ssr
Use any UI framework (React, Vue, Svelte, Solid, . ... With vite-plugin-ssr , you integrate tools manually and keep architectural control. Learn more....
Read more >
@vitejs/plugin-react - npm
The all-in-one Vite plugin for React projects.. Latest version: 3.0.0, last published: 17 days ago. Start using @vitejs/plugin-react in your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found