Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to import enable-check #91

Open
keyakko opened this issue Sep 14, 2021 · 2 comments
Open

Failed to import enable-check #91

keyakko opened this issue Sep 14, 2021 · 2 comments

Comments

@keyakko
Copy link

keyakko commented Sep 14, 2021

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

@medairbit
Copy link

medairbit commented Sep 16, 2021

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

@keyakko
Copy link
Author

keyakko commented Sep 20, 2021

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.

"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"default": "./dist/esm/index.js"
},
"./lib/*": {
"import": "./dist/esm/*.js",
"require": "./dist/cjs/*.js",
"default": "./dist/esm/*.js"
}
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants