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

BUG: Missing type declaration from exports in package.json #5398

Closed
2 tasks done
padcom opened this issue Sep 19, 2023 · 1 comment
Closed
2 tasks done

BUG: Missing type declaration from exports in package.json #5398

padcom opened this issue Sep 19, 2023 · 1 comment

Comments

@padcom
Copy link
Contributor

padcom commented Sep 19, 2023

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

chrome

Reproducible demo link

https://github.com/padcom/grapesjs-import-error

Describe the bug

0.21.6 changed the way things are exported and now VSCode doesn't see type declarations:

image

It happens when TypeScript uses:

  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true
  }

which is the default setting in @vue/tsconfig/tsconfig.json used in all Vue.js applications and also it is the default in all vite.js templates.

That's how it should look in https://github.com/GrapesJS/grapesjs/blob/dev/package.json#L12:

  "exports": {
    ".": {
      "import": "./dist/grapes.mjs",
      "require": "./dist/grapes.min.js",
      "types": "./dist/index.d.ts"
    },
    "./*": "./*"
  },

Code of Conduct

  • I agree to follow this project's Code of Conduct
@padcom
Copy link
Contributor Author

padcom commented Sep 19, 2023

PR: #5399

@artf artf closed this as completed in 7ac146c Sep 20, 2023
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

1 participant