odoo / mail-client-extensions

Other
26 stars 51 forks source link

Syntax error in main.js #40

Open arnaud-udf opened 5 months ago

arnaud-udf commented 5 months ago

Hello

After following all the steps detailed in the readme, I can't manage to deploy the build, neither manually nor via clasp.

It seems like there's a syntax error on line 2204 and 2220 in the main.js after compilation:

gmail_odoo

Any thoughts? Thanks!

cliffkujala commented 3 months ago

I am having the same issues @arnaud-udf

Did you find a solution?

cliffkujala commented 3 months ago

I was able to get this to build correctly. I did make some changes to the instructions.

  1. Instead of deleting the 3 lines that limit websites to only subdomains of odoo.com on the /src/views/login.ts file, I modified those lines to match my companies domain name.
  2. I also believe I had a problem with how rollup was handling @rollup/plugin-typescript. I previously installed that with npm install --save-dev @rollup/plugin-typescript but this time I installed it with npm install --global @rollup/plugin-typescript
  3. Before I performed npx rollup -c I also created a Script Property on my Apps Script Project for ODOO_SHARED_SECRET as mentioned on the iap_instructions.md file. Not sure if that had anything to do with it though to be honest.

In any case, the build files uploaded via clasp now without any syntax errors.

cliffkujala commented 2 months ago

I'm not sure why, but following my instructions which worked above failed when I tried them again. I do see the difference in a working main.js vs the one which has the errors @arnaud-udf posted on lines 2204 and 2220. The built file has a , at the end of lines 2203 and 2219 which should not be there. Make those sections like this and try again.

    const [partner, odooUserCompanies, canCreatePartner, canCreateProject, error] = Partner.enrichPartner(
        currentEmail.contactEmail,
        currentEmail.contactName
    );
    const state = new State(
        partner,
        canCreatePartner,
        currentEmail,
        odooUserCompanies,
        null,
        null,
        canCreateProject,
        error
    );