vue-tsx-support icon indicating copy to clipboard operation
vue-tsx-support copied to clipboard

Failed to import `enable-check`

Open keyakko opened this issue 2 years ago • 2 comments

Using this library with Nuxt.js will cause a fatal error.

Package subpath './enable-check' is not defined by "exports"
Screen Shot

I tried to import vue-tsx-support/enable-check into nuxt.config.ts. But when I start up the development environment, I get this error. This reproduction is here: https://codesandbox.io/s/vue-tsx-support-repro-import-issue-4o81s

keyakko avatar Sep 14 '21 10:09 keyakko

You need to add vue-tsx-support/enable-check.d.ts to the types array of your tsconfig

medairbit avatar Sep 16 '21 17:09 medairbit

Thanks for the response. I have tried the two patterns below. But it is not solved.

  • Add enable-check.d.ts path to the types array of tsconfig. (I got the same error as in the first comment.)
  • In Additional to the first pattern, remove the enable-check import from nuxt.config.ts. (I was able to launch nuxt, but I get a type error that cannot interpret the built-in HTML tags. Reproduction is here)

I think this error is occurred because enable-check is not exported in the package.json. https://github.com/wonderful-panda/vue-tsx-support/blob/6976afd342d1d3011a1eac7fa6627041bfe8feeb/package.json#L8-L19

keyakko avatar Sep 20 '21 03:09 keyakko