WARNING: All your builds using @frontity/now will break as of August 9th 2022

Just a heads up to fellow Frontity users who are using Vercel to deploy their sites.

As of August 9th 2022, Vercel is deprecating node v12.x.
The current builder that Frontity uses for deploying to Vercel, GitHub - frontity/now-builder: A Frontity builder for the Vercel hosting, is basically fixed to v12.x

We are currently looking for a solution for adjusting this, but just wanted to give a heads-up to the fellow frontity users that might have not heard about this. Once we have found a solution it will be shared here.

2 Likes

Wonder if the former core team help in any way here?

I have created a pull request for node v16x. Lets see if they review the change and merge it

Try @frederiknordahl/now in your vercel.json file instead of @frontity/now. This package supports Node.js 16.x runtime. I hope it helps.

Same but with node 14.x. No reaction yet.
I will now test the fork from @frederikhornahl. Hopefully that works as @anantajitjg suggested.

I have done a lot of testing and this simply doesn’t seem to affect the version or I am logging it not in the correct manner.
Also I noticed that LambdaRuntime doesnt support 16.x. See here: vercel/DEVELOPING_A_RUNTIME.md at main · vercel/vercel · GitHub

At the moment I am still in talks with Vercel, but they said they can’t really give us support for this as we are using a custom builder.

@luisherranz Luis, I know you are busy with other stuff, but would be great if you have a few minutes to give us your input.

Well that sucks :sweat_smile: - I am looking into this as well now, how are you logging which version is actually being run ?

Based on the docs of Vercel, there are 2 options:

In order to find out which Node.js version your Deployment is using, run node -v in the Build Command or log the output of process.version.

My first attempt was to add node -v after the frontity build command. So in package.json the build command looked like "build": "frontity build && node -v",. No matter what I did it stayed at 12.x.

Now I am trying to log process.version in the actual build function in the builder like this: now-builder/index.ts at master · DonKoko/now-builder · GitHub but that seems to log the version set in the settings, even though it doesn’t have an effect.

At first vecel support told me they cant help me because its a custom builder, but then I explained it uses @now/buiild-utils function createLambda() but no matter what I set it won’t change it. Since then they stopped answering. That was yesterday mid-day.

I will continue to test stuff. Let me know if you find something as I feel we have to confirm the version before being 100% sure it works.

Hmm, when I run “build”: “node -v && frontity build && node -v”, (wondered if it changed along the way) it says v16.15.0 :man_shrugging:

I’ll poke more around and see what happens.

I tried that as well. For me it still says 12.22.11. I did that with your version of now-builder.
Here is the output:

Could you maybe share how your package.json looks like. Also what do you have in the settings on vercel?

Weird! Actually my vercel nodejs is set to 14 (newest stable when I created the project) - my package json:

Thanks @appevolver2022, @ni.bonev, @frederik.nordahl.

I’ve merged the Node 16 PR because it seems like it’s supported (even though it’s not documented). Could you please check if it works in your setups?

2 Likes

I did a lot of testing and I think i found a bug in vercel. For me it doesn’t work on any of my team projects, but when I tried it on a project in my personal profile it worked and it set the version to 16. So that’s good. I have already contacted vercel support about it and I am also trying to debugg it myself.

Could you also update the npm package: @frontity/now - npm
It doesn’t seem to have the latest version live.

2 Likes

does the code on Vercel has 16x which I had added?

Once you have 16x change in your local code, create build for it and then push it on Vercel

Yeah that doesn’t solve it for me. I really think its a bug in Vercel. After digging deeper I found differences in the build log of the project that i moved to my personal account. Same project, no code changes but it works on personal user but not on team.

I have a confirmation from @frederik.nordahl that for him it works in team so I really think its something very weird. Still waiting for response from Vercel.

I will give an update once I know more but basically that whole part is missing from my logs when I deploy to a project in my team:

[15:41:45.920] Cloning github.com/Whale-Agency/rooftop-frontity-theme (Branch: main, Commit: 0a645a6)
[15:41:46.569] Cloning completed: 649.058ms
[15:41:47.478] Looking up build cache...
[15:41:47.715] Build Cache not found
[15:41:47.935] Running "vercel build"
[15:41:48.423] Vercel CLI 27.3.4
[15:41:48.522] WARN! Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
[15:41:48.884] yarn add v1.22.17
[15:41:48.904] info No lockfile found.
[15:41:48.924] [1/4] Resolving packages...
[15:41:50.398] warning @frederiknordahl/now > @now/[email protected]: "@now/node-bridge" is deprecated and will stop receiving updates January 2021. Please use "@vercel/node-bridge" instead.
[15:41:50.399] [2/4] Fetching packages...
[15:41:50.896] [3/4] Linking dependencies...
[15:41:50.896] warning " > @frederiknordahl/[email protected]" has unmet peer dependency "@now/[email protected]^0.9.4".
[15:41:50.965] [4/4] Building fresh packages...
[15:41:50.976] success Saved lockfile.
[15:41:50.980] success Saved 3 new dependencies.
[15:41:50.981] info Direct dependencies
[15:41:50.981] ├─ @frederiknordahl/[email protected]
[15:41:50.981] └─ @vercel/[email protected]
[15:41:50.981] info All dependencies
[15:41:50.981] ├─ @frederiknordahl/[email protected]
[15:41:50.981] ├─ @now/[email protected]
[15:41:50.981] └─ @vercel/[email protected]
[15:41:50.983] Done in 2.10s.

Ups, sorry. Released as 1.2.2 :slightly_smiling_face:

1 Like

Tested the official package, @frontity/now, and it is working fine.

3 Likes

Okey guys, I have an update for this.
Since yesterday builds have been failing. After investigating i found out that the build script was setting node to 18.x which doesn’t work for us.

I did a lot of investigation and looking at resources and PRs from the vercel team.
So because there is now node 18.x you actually need to specify the node version in the engines in your package.json, like this:

  "engines": {
    "node": "16.x"
  },

At first I thought its a bug as based on my testing, because when using a custom builder the engines property was ignored. I talked to some engineers at vercel and they said that its not a bug, it simply didnt affect out build before, because 16.x was the latest available version.

1 Like

Thank you so much. What a lifesaver. Had a critical update to do today.

Is there any plan or path to have Frontity update to work with future versions of Node? I know the main dev team no longer works on it, so I guess I’m asking if there’s anyone at all working on Frontity core these days?

2 Likes

@mburridge might know?