Custom processor bug, "name" is set to "read only"

Hi,

After struggling with my cf7 package for a few hours now, I wanted to see if there could be a bug in Frontity that is the problem. So I made a processor in a new test project, running the latest versions of everything. I found that if you try to set a name of the processor, you get the error:

TypeError: Cannot assign to read only property 'name' of function 'props=>{// Dummy setState to update the component.

And if you remove the name, you get the message:

The processor (missing name) needs both a "test" and a "processor" properties.
Visit https://community.frontity.org for help! 🙂

But this is my processor, it already has a test and a processor:

import React from 'react';
import { styled, connect } from "frontity";

const text = () => {
	<p>test</p>
}

const test = {
    //name: 'test',
    priority: 20,
	test: ({ component, props }) => component === "div" && props.className === "test-div",
		
	processor: () => {
		return {
		component: text
		}
	}

};

export default connect( test );

But I read in the documentation that processors also require a name, so I’m guessing that I get that message because I don’t have a name for it, but if I set a name, I get the first error message that I wrote about. An evil cycle.

@David Any ideas on this? :point_up:

Hi @juanma and @David!

I removed the connect(), and now the processor works.

I have another problem though. The cf7 package does not work after the lastest frontity update.

From what I can gather, it seems like the processors are never called, because the form is never replaced in the html. But I can’t figure out why the processors are not called. I have not changed anything.

Here is a repo with an updated cf7 that I have removed the conenct() from.

Hi again!

In the package index file, it was also exported with connect(), so I removed it, and now it works. :slight_smile:

1 Like