angularangular-clistackblitzngx-editor

How to make npm overrides work in stackblitz Angular CLI?


I want to replicate a bug in our Angular 14 project with NgxEditor on stackblitz. But I could not get pass the error Error: Can not convert <"Hello "> to a Fragment (looks like multiple versions of prosemirror-model were loaded). I fixed it in our local environment with this work-around. But it does not work on stackblitz: https://stackblitz.com/edit/ngx-editor-sacrnfh3?file=package.json

Btw: The bug makes backspace stop working after using ctrl+A to clear text


Solution

  • You can create a Node.js Project on StackBlitz.

    Then install Angular 14.

    npm i @angular/cli@14
    

    Then create a new project, using ng new:

    ng new test --style scss --routing
    

    Below is a StackBlitz demo to get started.

    Stackblitz Demo

    Replication Steps:

    1. cd test
      
    2. npm i --legacy-peer-deps
      
    3. << insert the npm override command here! >>
      
    4. npm run start
      

    This might maintain the npm overrides, if not, you can always specify the command to run in the reproduction steps when you raise the bug.