Issue #5398Opened September 19, 2023by padcom0 reactions

BUG: Missing type declaration from exports in package.json

Question

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

Answers (1)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.