clenemt/eleventy-webpack

Shortcodes.js error, `SyntaxError` was thrown: const lazy = args[4] ?? true;

Closed this issue · 2 comments

I get the following error when I try and build the site.

SyntaxError was thrown:
const lazy = args[4] ?? true;
Here are the two lines that have ? in them. Not sure what is wrong as I don't develop.
onst lazy = args[4] ?? true;
const sizes = args[5] ?? defaultSizes;
Could the problem be the ? mark?
Thanks,
Paul

The site builds correctly when I changed the node version to 14.15.1, per the .nvmrc file. The image is pushed to the left, so there must be a CSS problem which I will look into. Sorry for the too soon to make an issue. I will do better to check things out in the future.

Hey there, this is due to the fact that node does not support the null coalescing operator ?? in the version you are using.
There is a .nvmrc file at the root of the repo. This should be the minimum node version to use.

See https://github.com/nvm-sh/nvm for some more info