Designer Extension App - Webflow Javascript Error

We’re developing a Designer Extension app and are running into an error with the Webflow javascript that is injected via webflow extension serve.

The script that is injected is: https://d3e54v103j8qbb.cloudfront.net/gen/js/entrypoint-designer-extensions-client.e005ad9d9ff3e21975fd.js

The error we’re seeing is:
Uncaught SyntaxError: Invalid or unexpected token (at entrypoint-designer-extensions-client.e005ad9d9ff3e21975fd.js:91:106138)

CleanShot 2024-11-19 at 13.31.25@2x

This in turn appears to be blocking subsequent code such that the webflow object is not defined:
Uncaught (in promise) ReferenceError: webflow is not defined

We even started from scratch and created a brand new extension via the following:

$ webflow extension init foobar
$ cd foobar
$ npm run dev

The issue still persists even with a completely new/empty designer extension. Can someone on the dev support team take a look at the current version of the script above to see if this is something that you can fix?

Hi :wave: thanks for the report! What version of webflow-cli are you running? You should be able to get that via npm list @webflow/webflow-cli -g

Additionally, does this happen on all browsers? Does it happen when running an extension in non-dev mode (e.g. launching an App from the Designer)?

I am also seeing this error. Not sure if it was happening before but just noticed it today.

My webflow cli version is: @webflow/webflow-cli@1.6.12
Happens both on Brave & Firefox browsers. However on Firefox the error reads “Uncaught SyntaxError: illegal character U+20AC”.

It only happens on my local app in development mode. Published apps don’t have this error.

EDIT:
I also just noticed I’m now getting a webflow is not defined error which I definitely wasn’t getting before & is now breaking functionality.

The app was originally initialized with version 1.6.5. I installed the latest version (1.6.13), and added the "apiVersion": "2" parameter to webflow.json, but the error persists.

However, after installing 1.6.13, I can now generate a completely new app successfully using the commands above - it appears to load the same Javascript file, but the error is gone.

Are there any additional steps to take when updating webflow-cli in an existing project?

Hmm… I just updated to 1.6.13 & ran the same commands to create a fresh app but I still see the error.

Are you also getting a webflow is not defined error if you click on one of the buttons on the template app?

Ah wait, I just had to also refresh the webflow tab after updating my webflow-cli version & creating a new app. Both errors are gone now!

But also unsure how to fix my previous app…

I wouldn’t expect the upgrading of webflow-cli to fix it, I more so asked that to ensure I was trying to reproduce using the same setup. Also webflow-cli should be installed globally, so if it did fix the serving of one App in theory it should fix the other.

We are attempting to reproduce though so we can better help debug.

Thanks james! Any update?

Adding <meta charset="UTF-8" /> to your index.html fixes it. I was able to reproduce by removing that (which shows the error you saw) and then adding it back in fixed it.