Our pure JavaScript Scheduler component


Post by MichaelZhu »

Hi,

I'm using the customize form to edit the Event. Everything is OK, but some time run into bellow error.

saveHandler() {
      var me = this;
      // calling this method updates also duration (resizes the event)
      me.eventRecord.set({
        name: me.formData.eventName,
     ...
      });
      me.eventRecord.setStartEndDate(
        me.formData.startDate,
        me.formData.endDate
      );

if (!me.eventRecord.eventStore) {
    me.eventStore.add(me.eventRecord);
    me.eventRecord.resourceId = me.resourceId;
  }
  
  me.eventRecord.project.sync().then(() => {
    ...
  });
  // close the editor
  me.editorShown = false;

When execute bellow code

 if (!me.eventRecord.eventStore) {
        me.eventStore.add(me.eventRecord);
        me.eventRecord.resourceId = me.resourceId;
      }
 

throw bellow exception

chunk-vendors.js:500868 [Vue warn]: Error in v-on handler: "Error: Unknown identifier ClassDefEx.$.direction"

found in

---> <BModal>
       <EventEditor1> at src/view/production/EventEditor1.vue
         <ProductionPlanTaskView1> at src/view/production/productionPlanTaskView1.vue
           <Layout> at src/view/layout/Layout.vue
             <MetronicVue> at src/App.vue
               <Root>
warn @ chunk-vendors.js:500868
logError @ chunk-vendors.js:502131
globalHandleError @ chunk-vendors.js:502126
handleError @ chunk-vendors.js:502086
invokeWithErrorHandling @ chunk-vendors.js:502109
invoker @ chunk-vendors.js:502426
invokeWithErrorHandling @ chunk-vendors.js:502101
Vue.$emit @ chunk-vendors.js:504130
hide @ chunk-vendors.js:329426
onOk @ chunk-vendors.js:329617
invokeWithErrorHandling @ chunk-vendors.js:502101
invoker @ chunk-vendors.js:502422
original._wrapper @ chunk-vendors.js:507155
chunk-vendors.js:502135 Error: Unknown identifier ClassDefEx.$.direction
    at throwUnknownIdentifier (20.js:35170)
    at EngineTransaction.get (20.js:35170)
    at EngineReplica.get (20.js:35170)
    at TemplateClass.getFromGraph (20.js:35170)
    at ClassDefEx.get (20.js:35170)
    at ClassDefEx.getStartDatePinConstraintType (20.js:51323)
    at ClassDefEx.writeStartDate (20.js:51323)
    at EngineTransaction.addIdentifier (20.js:35170)
    at EngineTransaction.addIdentifier (20.js:39685)
    at EngineReplica.addIdentifier (20.js:35170)
logError @ chunk-vendors.js:502135
globalHandleError @ chunk-vendors.js:502126
handleError @ chunk-vendors.js:502086
invokeWithErrorHandling @ chunk-vendors.js:502109
invoker @ chunk-vendors.js:502426
invokeWithErrorHandling @ chunk-vendors.js:502101
Vue.$emit @ chunk-vendors.js:504130
hide @ chunk-vendors.js:329426
onOk @ chunk-vendors.js:329617
invokeWithErrorHandling @ chunk-vendors.js:502101
invoker @ chunk-vendors.js:502422
original._wrapper @ chunk-vendors.js:507155
20.js:35170 Uncaught (in promise) Error: Unknown identifier ClassDefEx.$.dispatcher
    at throwUnknownIdentifier (20.js:35170)
    at EngineTransaction.onReadIdentifier (20.js:35170)
    at EngineTransaction.calculateTransitionsStackGen$ (20.js:35170)
    at tryCatch (20.js:1457)
    at Generator.invoke [as _invoke] (20.js:1687)
    at Generator.next (20.js:1512)
    at tryCatch (20.js:1457)
    at maybeInvokeDelegate (20.js:1750)
    at Generator.invoke [as _invoke] (20.js:1661)
    at Generator.next (20.js:1512)
throwUnknownIdentifier @ 20.js:35170
onReadIdentifier @ 20.js:35170
calculateTransitionsStackGen$ @ 20.js:35170
tryCatch @ 20.js:1457
invoke @ 20.js:1687
(anonymous) @ 20.js:1512
tryCatch @ 20.js:1457
maybeInvokeDelegate @ 20.js:1750
invoke @ 20.js:1661
(anonymous) @ 20.js:1512
_callee178$ @ 20.js:35170
tryCatch @ 20.js:1457
invoke @ 20.js:1687
(anonymous) @ 20.js:1512
asyncGeneratorStep @ 20.js:19
_next @ 20.js:41
(anonymous) @ 20.js:48
(anonymous) @ 20.js:37
runGeneratorAsyncWithEffect @ 20.js:35170
(anonymous) @ 20.js:35170
setTimeout (async)
scheduleAutoCommit @ 20.js:35170
addIdentifier @ 20.js:35170
enterGraph @ 20.js:35170
addEntity @ 20.js:35170
joinProject @ 20.js:35170
joinStore @ 20.js:35170
(anonymous) @ 20.js:12303
onDataChange @ 20.js:12303
trigger @ 20.js:4816
splice @ 20.js:10003
add @ 20.js:9924
add @ 20.js:10471
add @ 20.js:11919
add @ 20.js:38502
processRecords @ 20.js:37130
add @ 20.js:10471
add @ 20.js:11919
add @ 20.js:37291
saveHandler @ 29.js:172352
invokeWithErrorHandling @ chunk-vendors.js:502101
invoker @ chunk-vendors.js:502426
invokeWithErrorHandling @ chunk-vendors.js:502101
Vue.$emit @ chunk-vendors.js:504130
hide @ chunk-vendors.js:329426
onOk @ chunk-vendors.js:329617
invokeWithErrorHandling @ chunk-vendors.js:502101
invoker @ chunk-vendors.js:502422
original._wrapper @ chunk-vendors.js:507155 

Post by mats »

How can we replicate this? Can you please upload a minimal test case?


Post by MichaelZhu »

FYI

Attachments
custom-event-editor.zip
(605.95 KiB) Downloaded 75 times
Vue Custom Event Editor demo - Google Chrome 2021-04-21 22-30-19.zip
(2.67 MiB) Downloaded 112 times

Post by alex.l »

What version of the SchedulerPro do you use?

All the best,
Alex


Post by MichaelZhu »

4.0.8


Post by MichaelZhu »

Any update? Same error in 4.1.0


Post by alex.l »

Hi MichaelZhu,

Your application was not runnable, so I was need to update paths in your package.json to be able to run it.
I tried to save the event using your custom event editor and I don't see the error you mentioned, but I see another one:

schedulerpro.module.js Uncaught (in promise) Error: Trying to request without URL specified

that happened because you put project configuration into features object, which is not correct.

Could you please check your application again, make it runnable from our examples folder and provide steps to reproduce the issue you mentioned in your first post?
At a first glance it looks like "race-condition" bug (some of components that Vue listening has been destroyed faster), but I cannot be sure because I didn't reproduce the bug.

Best regards,
Alex

All the best,
Alex


Post by MichaelZhu »

Hi Alex,

I have migrated to 4.1.0 and please refer my prev screen capture (download/file.php?id=13063) to reproduce the issue.

Regards

Attachments
test.zip
(690.59 KiB) Downloaded 78 times

Post by saki »

You need to add transport config to your project, for example:

      project: {
        autoLoad: false,
        transport : {
          sync:{
            url:'./success.json',
            method: 'GET'
          }
        }
      },

See https://bryntum.com/docs/scheduler-pro/#SchedulerPro/model/ProjectModel#built-in-crudmanger please.


Post by MichaelZhu »

Hi Saki,

There's no problem for the data load and sync. It run into error when try to add event to event store.

...
if (!me.eventRecord.eventStore) {
    me.eventStore.add(me.eventRecord);
    me.eventRecord.resourceId = me.resourceId;
  }
  ...
  

Please refer the screen capture uploaded.

Regards


Post Reply