Forum Academy Marketplace Showcase Pricing Features

JS Parse Errors When Submitting A New Version

Hey there experienced plugin builders… so I’ve spent a week beavering away at my javascript which now runs perfectly when my plugin is in test mode. I go to “Submit a New Version” and I get the message:

js%20error

Can you recommend the best external tool to check my code with?

I have both a server action and an element action.
I’ve tried http://esprima.org/demo/validate.html, and the code passes, but still fails to “Submit” in the plugin editor.

Thanks!
Antony.

Same error here, did you manage to solve it by any chance?

Good question! It was a while ago now… I recall that I put my Javascript through various syntax checkers and found some bits of syntax weren’t entirely correct… and I also found that Bubble is very sensitive about the format of the opening function call line… things like extra spaces which you wouldn’t usually expect to be an issue… so maybe create a new empty action and just check that opening line is exactly the same…

Good luck! :slight_smile:

2 Likes

After weeks of building my plugin I’m also stuck with this… @antony @akieffer any more advice?

Check your actions. Put them thru a traditional code editor like vscode or jsfiddle to help find code errors

I’ve tried and everything seems ok apart from the first line because the function is not defined.

function(properties, context) {

thanks,

Phill

Well…
If that’s the only line then your missing an ending bracket too.

Ha, I wish my plugin was that simple… Have you had this error before when publishing a plugin? What did you do to fix it?

For me, this always means I have messed up some braces { } somewhere - effectively a JS error. I basically just comment out code and open up the editor in full screen and close (which seems to make the editor re-evaluate the js code) until I find the naughty or missing brace.

1 Like

Thanks for the suggestion, I’ve just tried this as well as validating my code in VS Code and online validators. No curly braces missing and no validation errors! I have no idea where to go next with this :confused:

Want a second pair of eyes on the code?

1 Like

Thanks for the offer, I may take you up on that. In the meantime, I’ve put in a support ticket with Bubble so lets see what they come back with.

All sorted! Bubble support had a look and found that when you changed one of my actions from server-side to client-side, the code had a duplicate ‘function(properties, context) {’ for some bizarre reason.