ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
8.78k stars 3.64k forks source link

Failed to resolve `process` while compiling using `Parcel` #16513

Open Mati365 opened 1 month ago

Mati365 commented 1 month ago

📝 Provide detailed reproduction steps (if any)

  1. Extract package.zip bundle
  2. Install dependencies npm install
  3. Run Parcel build npx parcel index.html

✔️ Expected result

Should compile without errors.

❌ Actual result

Throws Failed to resolve process

Server running at http://localhost:32829
🚨 Build failed.

@parcel/core: Failed to resolve 'process' from 
'./node_modules/@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js'

  /home/mateusz/Projekty/cksource/new-installation-methods/parcel/node_modules/@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js:27:29

❓ Possible solution

Polyfill process in Parcel.

📃 Other details


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

Mati365 commented 1 month ago

Found solution. Adding alias in package.json solves the issue. Example package.json:

{
  "type": "module",
  "dependencies": {
    "@ckeditor/ckeditor5-react": "^8.0.0-alpha.0",
    "buffer": "^6.0.3",
    "ckeditor5": "^42.0.0-alpha.0",
    "ckeditor5-premium-features": "^42.0.0-alpha.0",
    "parcel": "^2.12.0"
  },
  "@parcel/resolver-default": {
    "packageExports": true
  },
  "alias": {
    "process": {
      "global": "{}"
    }
  },
  "devDependencies": {
    "react": "^18.3.1",
    "react-dom": "^18.3.1"
  }
}