privatenumber / vue-frag

šŸ¤² Create Fragments (multiple root-elements) in Vue 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eslint error: Fragment not found in 'vue-frag'

aslak01 opened this issue Ā· comments

Hey,

I get this error when importing fragment in a component:

Screenshot 2022-11-04 at 10 35 08

Workaround is to import like this:

import Frag from 'vue-frag'
(...)
  components: {
    Fragment: Frag.Fragment,
  }

Edit: strike the workaround, it got rid of the error, but the plugin stopped working. Just disabling eslint instead for now.

I'm not sure what ESLint rules you're using that's emitting the error.

If you mean TypeScript, maybe esModuleInterop is not enabled?

If not, can you provide a minimal reproduction?
I can't help you with the information you provided so far.

I'm not working on that project anymore, so I'm sorry, but I can't really answer your suggestion or provide a minimal repro. It is a Vue 2 TS project, so it's quite possible that the problem is esModuleInterop not being enabled. I just reported it here because I didn't see anything similar from other packages, so if it is some TS setting causing it, it might warrant a comment in the readme or something.

It's standard TypeScript practice to enable esModuleInterop when using import statements that compile to CommonJS.

Closing this out as un-actionable since you can't provide more information.