codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.82k stars 2.09k forks source link

v2.27.0 is failing to bundle as an ESM in jsdelivr #2361

Open dobbs opened 1 year ago

dobbs commented 1 year ago

A few days ago my use of editor.js stopped working. I think it is related to the 2.27.0 release. I rely on the jsdelivr CDN as the source for editor.js. That CDN is correctly building v2.26.5 but is failing with v2.27.0. Also, the onset of my symptoms coincide with the release date for v2.27.0.

Steps to reproduce: Visit https://cdn.jsdelivr.net/npm/@editorjs/editorjs@2.27.0/+esm Notice the message "Failed to bundle using Rollup v2.79.1."

Expected behavior: jsdelivr is able to build v2.26.5 Visit https://cdn.jsdelivr.net/npm/@editorjs/editorjs@2.26.5/+esm

Screenshots:

/**
 * Failed to bundle using Rollup v2.79.1.
 * If you believe this to be an issue with jsDelivr, and not with the package itself, please open an issue at https://github.com/jsdelivr/jsdelivr
 */

 throw new Error('Failed to bundle using Rollup v2.79.1. If you believe this to be an issue with jsDelivr, and not with the package itself, please open an issue at https://github.com/jsdelivr/jsdelivr');

Device, Browser, OS: MacBook Pro 2020, Firefox 112.0.2, MacOS 13.3.1 (22E261)

Editor.js version: 2.27.0

Plugins you use with their versions: Here's how I import the two plugins I use, but my code doesn't get to these lines because it fails when importing editor.js

    import SimpleImage from "https://cdn.jsdelivr.net/npm/@editorjs/simple-image/+esm"
    import LinkTool from "https://cdn.jsdelivr.net/npm/@editorjs/link/+esm"
fyrye commented 9 months ago

Seems the last version that was built correct was https://cdn.jsdelivr.net/npm/@editorjs/editorjs@2.27.0-rc.4/+esm

And it began failing Rollup and Terser passes in the 2.27.0-rc.5 and later: https://cdn.jsdelivr.net/npm/@editorjs/editorjs@2.27.0-rc.5/+esm

Not versed enough in the code-base to figure out where things broke.

fakob commented 7 months ago

Hi, I am wondering if anyone is doing import editorjs successfully from a CDN? I still get the same error as mentioned above. Are there any updates on this?

conradfr commented 6 months ago

I get the same error using Symfony AssetsMapper (which outputs an error citing Rollup).

2.26.5 works fine.

A bit sad as we're at 2.29 now.

Individual tools import fine.