Giter Club home page Giter Club logo

Comments (5)

kevinchappell avatar kevinchappell commented on July 29, 2024

events.js needs a wrapper similar to the one in formBuilder https://github.com/kevinchappell/formBuilder/blob/master/src/js/events.js

from formeo.

kokhoor avatar kokhoor commented on July 29, 2024

Any hints how to fix it? As the events.js in formeo (where the error seems to be flagged) seems to be based on CustomEvent.

from formeo.

kokhoor avatar kokhoor commented on July 29, 2024
  1. To at least enable my vue app to compile, what I did was add following to utils.js:
export const createCustomEvent = (eventName, data) => {
  let event;
  if (typeof CustomEvent === 'function') {
    event = new CustomEvent(eventName, data);
  } else {
    event = document.createEvent('CustomEvent');
    event.initCustomEvent(eventName, true, true, data);
  }

  return event;
};

Wherever I see a new CustomEvent call in the existing code (say events.js), I did this:

import {createCustomEvent} from './utils';
...
formeoSaved: createCustomEvent('formeoSaved', {}),
...
  1. In formeo.js I added Object.assign from Mozilla Developer Network (I temporarily disabled ESLint in the process as it doesn't allow varArgs and changing it to ...varArgs doesn't work due to presence of 'use strict';
if (typeof Object.assign != 'function') {
  // Must be writable: true, enumerable: false, configurable: true
  Object.defineProperty(Object, 'assign', {
    value: function assign(target, varArgs) { // .length of function is 2
      'use strict';
      if (target == null) { // TypeError if undefined or null
        throw new TypeError('Cannot convert undefined or null to object');
      }

      let to = Object(target);

      for (let index = 1; index < arguments.length; index++) {
        let nextSource = arguments[index];

        if (nextSource != null) { // Skip over if undefined or null
          for (let nextKey in nextSource) {
            // Avoid bugs when hasOwnProperty is shadowed
            if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
              to[nextKey] = nextSource[nextKey];
            }
          }
        }
      }
      return to;
    },
    writable: true,
    configurable: true
  });
}
  1. Once both done, formeo at least displayed form I loaded from memory although initially I received unspecified error at call to window.getComputedStyle (Invalid operation)

I am not sure what I did is correct, but my vue-base website working reasonably now.

from formeo.

kevinchappell avatar kevinchappell commented on July 29, 2024

great work @kokhoor
The CustomEvent polyfill and Object.assign polyfills will be added to the next release

from formeo.

zzekikaya avatar zzekikaya commented on July 29, 2024

Hi,

I have same problem. when will you fix that problem.
enjoy working !

from formeo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.