holtwick / zeed-dom

🌱 Lightweight offline DOM
MIT License
33 stars 5 forks source link

Named export decode not found in he commonjs module #4

Closed gustojs closed 2 years ago

gustojs commented 2 years ago

Hi, is there a way to resolve the following?

Zeed-dom 0.9.23 (as a tiptap dependency) WSL on Windows 10 Node 16.14

file:///home/gustojs/playby-nuxt3/node_modules/zeed-dom/dist/index.js:22
import { decode } from "he";
         ^^^^^^
SyntaxError: Named export 'decode' not found. The requested module 'he' 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 'he';
const { decode } = pkg;

Thanks!

holtwick commented 2 years ago

Oh, one moment, I'll have a look.

gustojs commented 2 years ago

I can now confirm that hardcoding:

import pkg from 'he';
var { decode } = pkg;

does solve the problem.

holtwick commented 2 years ago

Fixed by integrating he altogether. Those dependencies only cause troubles ;)

See https://github.com/holtwick/zeed-dom/commit/d58f47f2d687be77c1a8b70264995d057eb0c325

gustojs commented 2 years ago

Great, thanks a lot for fast action! <3