From the error message I would guess you’re writing Motoko. Guessing further form that is that a Motoko compiler upgrade changed acceptable syntax. Would you mind sharing the relevant section of the code?
Thanks for replying Severin - we don’t know what code is throwing the error, the output above is all we have. We have narrowed it down to one canister but not what code causes the issue.
Since the error happens when moving from 0.9.2 to 0.9.3, I had a look at the dfx changelog. There, it says “Updated Motoko from 0.6.21 to 0.6.25.”. Maybe the Motoko changelog for those versions is helpful to narrow it down?
That log provides some helpful clues, especially since we don’t have the source code yet in the thread.
I wonder if one of the recent fixes exposed a latent issue in the stable variable definitions of the code? It could be that it should not have parsed before, but only did because of that now-fixed issue being unfixed earlier.
@paulk if you share that line of the code, maybe we can help spot the relevant remedy.
-- Parsing stable-types:
.../Projects/modclub/src/modclub/service/poh/poh.mo:1583.25-1583.37: warning [M0154], field append is deprecated:
Array.append has critical performance flaws; use a Buffer, and Buffer.append, instead.
.../Projects/modclub/src/modclub/service/poh/poh.mo:1590.32-1590.44: warning [M0154], field append is deprecated:
Array.append has critical performance flaws; use a Buffer, and Buffer.append, instead.
.../Projects/modclub/src/modclub/service/poh/poh.mo:1595.20-1595.32: warning [M0154], field append is deprecated:
Array.append has critical performance flaws; use a Buffer, and Buffer.append, instead.
stable-types:8.5-8.9: syntax error [M0001], unexpected token 'type', expected one of token or <phrase> sequence:
}
seplist(<typ_field>,<semicolon>) }
We are having the same issue when upgrading from 0.9.2 to 0.11.2 .
I attempted to build without the “stable-type” command but still got the same error:
The file is internally generated by moc from the stable variable declarations in the code and embedded in a custom section of the wasm.
Because earlier, buggy versions of moc sometimes produced ill-formed stable-type files, we added a check that verifies the generated file is valid by parsing and verifying it to detect bugs early.
I think that check might be failing, and has detected a bug.
If you can share the source code, or some cut down version of it including just the stable variables, then we might be able to pinpoint the issue.
Another, perhaps easier, helpful thing to share might be the .most file produced by the working compiler (dfx 0.9.2, moc 0.6.21?) with option --stable-types.
This .most file is bad. type Bucket/2 = Bucket/1. / cannot be a valid variable character. I think we have fixed this, but the file produced by an earlier compiler still exists. Can you override the error? dfx usually asks if you want to continue deploy, you can just say “yes”.
I see, I’ve tried to generate a new .most file by commenting out the canister, but found it still throws the error upon reinstall and doesn’t offer a continue prompt, just Stderr.