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

It's impossible to compile editor using Parcel bundler #16487

Closed
Mati365 opened this issue Jun 5, 2024 · 1 comment
Closed

It's impossible to compile editor using Parcel bundler #16487

Mati365 opened this issue Jun 5, 2024 · 1 comment
Labels
domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. resolution:invalid This issue is invalid (e.g. reports a non-existent bug or a by-design behavior). type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Mati365
Copy link
Member

Mati365 commented Jun 5, 2024

📝 Provide detailed reproduction steps (if any)

  1. Paste this package.json file and npm install
{
  "type": "module",
  "dependencies": {
    "ckeditor5": "^42.0.0-alpha.0",
    "ckeditor5-premium-features": "^42.0.0-alpha.0",
    "parcel": "^2.12.0"
  }
}
  1. Create index.html with with this content:
<html>
  <head>
    <title>My First Parcel App</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <h1>Editor</h1>
    <script type="module" src="app.ts"></script>
  </body>
</html>
  1. Create app.ts with this content:
import { ClassicEditor, Essentials } from 'ckeditor5';

import coreTranslations from 'ckeditor5/translations/pl.js';
import commercialTranslations from 'ckeditor5-premium-features/translations/pl.js';

ClassicEditor.create( document.body.querySelector( '#editor' ) as HTMLElement, {
  plugins: [
    Essentials
  ],
  translations: [
    coreTranslations,
    commercialTranslations
  ],
  language: 'pl'
} );
  1. Run server: npx parcel index.html

✔️ Expected result

Should compile without errors

❌ Actual result

  1. It's impossible to import paths specified by ckeditor5 package.json exports section (such like translations).
  2. It's impossible to import CSS files import ckeditor5/ckeditor5.css.
Failed to resolve 'ckeditor5/translations/pl.js'

obraz

📃 Other details

  • OS: Fedora 40

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@Mati365 Mati365 added type:bug This issue reports a buggy (incorrect) behavior. release:potential-blocker This issue potentially blocks the upcoming release (should be checked). labels Jun 5, 2024
@Mati365 Mati365 changed the title It's impossible to compile editor with translations using default Parcel builder configuration It's impossible to compile editor with translations using Parcel bundler Jun 5, 2024
@Mati365 Mati365 changed the title It's impossible to compile editor with translations using Parcel bundler It's impossible to compile editor using Parcel bundler Jun 5, 2024
@Mati365
Copy link
Member Author

Mati365 commented Jun 5, 2024

Found solution. It's crucial to add packageExports to project package.json file. Like this one:

{
  "type": "module",
  "dependencies": {
    "ckeditor5": "^42.0.0-alpha.0",
    "ckeditor5-premium-features": "^42.0.0-alpha.0",
    "parcel": "^2.12.0"
  },
  "@parcel/resolver-default": {
    "packageExports": true
  }
}

Parcel ignores exports section in package.json by default.

@Mati365 Mati365 removed the release:potential-blocker This issue potentially blocks the upcoming release (should be checked). label Jun 5, 2024
@Mati365 Mati365 closed this as completed Jun 5, 2024
@Mati365 Mati365 added the release:potential-blocker This issue potentially blocks the upcoming release (should be checked). label Jun 6, 2024
@Mati365 Mati365 reopened this Jun 6, 2024
@Witoso Witoso added domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. and removed release:potential-blocker This issue potentially blocks the upcoming release (should be checked). labels Jun 10, 2024
@filipsobol filipsobol closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
@Witoso Witoso added the resolution:invalid This issue is invalid (e.g. reports a non-existent bug or a by-design behavior). label Jun 12, 2024
@Witoso Witoso mentioned this issue Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:integration-dx This issue reports a problem with the developer experience when integrating CKEditor into a system. resolution:invalid This issue is invalid (e.g. reports a non-existent bug or a by-design behavior). type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

3 participants