Closed Redemption198 closed 2 years ago
Awesome, want to make a PR?
Awesome, want to make a PR?
Sure. It's here https://github.com/steveruizok/perfect-freehand/pull/55
Hello, I have an issue connected to this one in here. I guess the only thing remaining to do is to release the current version, if that's not a big deal.
This has been released. v1.2.2
This module is being used by Drauu which has an integration with VueUse and can be used with Nuxt (Vue). Since Nuxt 3 uses Vite as a bundler by default and it only allows the use of ESM modules, when it tries to bundle
perfect-freehand
the following error occurs:import { getStroke } from "perfect-freehand"; ^^^^^^^^^ SyntaxError: Named export 'getStroke' not found. The requested module 'perfect-freehand' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using:
import pkg from 'perfect-freehand'; const { getStroke } = pkg;
I was able to "fix" it by adding the following lines into the
package.json
insidenode_modules
:"type": "module", "exports": { ".": { "types": "./dist/types/index.d.ts", "import": "./dist/esm/index.js" } }
I'm not sure if this may cause some problems that's why I'm opening an Issue