According to the docs this is how vars should be defined:
vars = {
FOO = "0f2ac74b498b48028cb68387c421e279",
BAR = "068c101e168d03c65bddf4ba75150fb0"
}
https://developers.cloudflare.com/workers/tooling/wrangler/configuration
But this produces the error:
Error: expected a table key, found a newline at line 7 column 9 in wrangler.toml
Putting everything in a single line solves it... but it's pretty ugly.
vars = { FOO = "0f2ac74b498b48028cb68387c421e279", BAR = "068c101e168d03c65bddf4ba75150fb0"}
node -v: v12.16.1wrangler -V: wrangler 1.8.1Hey @PierBover - there are two different ways to define tables in TOML, the one described in the docs is the inline style.
If you want to have them on multiple lines you should be able to follow this also valid style:
[vars]
FOO = "1234"
BAR = "5678"
Thanks @EverlastingBugstopper !
You should probably update those docs though...
But it seems not working when using environments :(
[env.staging]
[vars]
FOO = "bar"
[env.production]
[vars]
FOO = "baz"
$ wranger build -e staging
# Error: redefinition of table `vars` for key `vars` at line XX column X in wrangler.toml
@delphaber you'll need to define like so
[env.staging.vars]
FOO = "bar"
[env.production.vars]
FOO = "baz"
the error you're seeing is because your TOML is invalid - you can copy and paste your toml file here and see that it gives you a very similar error
Thank you!
Most helpful comment
@delphaber you'll need to define like so
the error you're seeing is because your TOML is invalid - you can copy and paste your toml file here and see that it gives you a very similar error