Deploying to Vercel Issues

Hello team,

Have some issues with the deployment on Vercel. I got this error, which i don’t really know what that means…

Locally works everything fine.

Do you know what may cause this error?
Thank you very much.
Best,
Dejan

Hi @dejangeorgiev

What do you get locally if you run npx frontity build followed by npx frontity serve? Does that work or do you get a similar error?

hi @mburridge

When i run npx frontity build i get this:
image
But when i run npx frontity serve i get this error:
image

Thanks.

Hi @dejangeorgiev

But you don’t get this error with npx frontity dev?!

hi @mburridge
That’s true. I don’t get this error when i run npx frontity dev,

Hmm :thinking: - do you have a repo we can clone?

Yes. Here you go: https://github.com/dejangeorgiev/ruthgeorgiev-frontity

Hi @dejangeorgiev

Thanks. I’ve cloned the repo locally and confirm that I get the same error with npx frontity build and npx frontity serve. I’ve also deleted and reinstalled the node_modules folder and package-lock.json file and still got the same result. I’ve consulted this related thread and our troubleshooting guide but to no avail.

I’ll refer this to our dev team, to see if they can shed any light on this.

2 Likes

hi @mburridge

Thank you very much for checking it and reaching out to the developers.
Waiting on your feedback for further actions.

I’ve had this problem in the past. I would recommend removing all node_modules folders and package-lock.json files et al. with this command:

rm -rf node_modules && rm -rf package-lock.json && rm -rf yarn-error.log && rm -rf yarn

Then reinstall with npm install or yarn. This will recreated the package-lock.jsons throughout the project and resolved my issues.

I had just posted something today since I had this problem with another of my projects and @juanma originally helped me with it. Let us know if that command and reinstalling all packages helps because I think this is a bug and should be addressed.

As per this thread.

Hi @david1

Thank you very much for your respond.
I’ve already tried removing all node_modules as well as package-lock.json and reinstalling npm before i opened this thread. It didn’t worked for me.

Also @mburridge tried today with a fresh installation and it didn’t worked for him as well.

Anyway thank you very much for you kind help!
Best.

The error is Cannot read property 'flags' of undefined, so it looks like this problem to me: Error: Did you forget to run "frontity build"?

The problem was fixed in the July release: Frontity release: First stable version of Google Analytics, Google Tag Manager and Comscore packages

  • @dejangeorgiev are you sure you’re running the latest versions of Frontity?
  • Can you do a npx frontity info and paste the result here?

:slightly_smiling_face:

Hello @luisherranz :wave:t3:

Thank you very much for your respond.

Yes, i’ve already updated to the latest Frontity version. (see the screenshot)

Should i update the Google Analytics, as well as Google Tag Manager?

Hello @luisherranz

Now i updated all packages to the latest version


System:

  • OS: macOS 10.15.4
  • CPU: (8) x64 Intel® Core™ i7-4770HQ CPU @ 2.20GHz
  • Memory: 2.78 GB / 16.00 GB
  • Shell: 5.7.1 - /bin/zsh

Binaries:

  • Node: 12.16.2 - /usr/local/bin/node
  • npm: 6.14.4 - /usr/local/bin/npm

Browsers:

  • Chrome: 84.0.4147.135
  • Edge: Not Found
  • Firefox: Not Found
  • Safari: 13.1

npmPackages:

  • @babel/preset-react: ^7.9.4 => 7.10.4
  • @babel/types: ^7.9.5 => 7.11.0
  • @frontity/analytics: ^1.2.0 => 1.2.0
  • @frontity/connect: ^1.1.3 => 1.1.3
  • @frontity/core: ^1.7.3 => 1.7.3
  • @frontity/google-ad-manager: ^0.1.0 => 0.1.0
  • @frontity/google-analytics: ^1.2.0 => 1.2.0
  • @frontity/google-tag-manager-analytics: ^1.0.0 => 1.0.0
  • @frontity/head-tags: ^1.0.5 => 1.0.5
  • @frontity/html2react: ^1.3.5 => 1.3.5
  • @frontity/lazyload: ^1.0.12 => 1.0.12
  • @frontity/now: ^1.2.0 => 1.2.0
  • @frontity/tiny-router: ^1.2.1 => 1.2.1
  • @frontity/twentytwenty-theme: ./packages/twentytwenty-theme => 1.1.1
  • @frontity/wp-source: ^1.8.1 => 1.8.1
  • @types/youtube: 0.0.39 => 0.0.39
  • babel-plugin-macros: ^2.8.0 => 2.8.0
  • babel-plugin-tailwind-components: ^0.5.10 => 0.5.10
  • frontity: ^1.10.1 => 1.10.1
  • frontity-contact-form-7: ^0.1.7 => 0.1.7
  • react-elastic-carousel: ^0.6.7 => 0.6.7
  • react-headroom: ^3.0.0 => 3.0.0
  • react-id-swiper: ^4.0.0 => 4.0.0
  • react-intersection-observer: ^8.26.2 => 8.27.1
  • react-mailchimp-subscribe: ^2.1.0 => 2.1.0
  • react-share: ^4.2.1 => 4.2.1
  • react-spring: ^8.0.27 => 8.0.27
  • react-youtube: ^7.11.2 => 7.12.0
  • styled-components: ^5.1.1 => 5.1.1
  • styled-components/macro: undefined ()
  • styled-components/native: undefined ()
  • styled-components/primitives: undefined ()
  • swiper: ^5.4.5 => 5.4.5
  • tailwind.macro: ^1.0.0-alpha.10 => 1.0.0-alpha.10
  • tailwindcss: ^1.4.6 => 1.7.5

npmGlobalPackages:

  • frontity: Not Found
  • npx: Not Found

but when i run npx frontity build i still get Cannot read property 'flags' of undefined

Recently, I have started learning and experimenting with Frontity and came across this the exact same issue. I have tried whatever is suggested in this tread but still the same, no idea what to do or what I did wrong. :face_with_thermometer:

Here is the repo: https://github.com/Divaksh/forgotten-developer

Code is working fine on localhost (both build and serve commands)

>_ npx frontity build
mode: production

Building es5 bundle
Building module bundle
Building server bundle
 
>_ npx frontity serve
SERVER STARTED -- Listening @ http://localhost:3000

Here is the error I’m getting from vercel

|12:44:42.573  |> frontity build|
|---|---|
|12:44:43.320  |mode: production|
|12:44:43.400  |Building es5 bundle|
|12:44:55.343  |Building module bundle|
|12:45:01.221  |Building server bundle|
|12:45:10.315  |Error: Something went wrong with the build. Please run `npx frontity dev --production` locally to find out.|
|12:45:10.315  |    at Object.build (/vercel/d1569233ba8abb51/.build-utils/.builder/node_modules/@frontity/now/dist/index.js:84:19)|
|12:45:10.315  |    at async buildStep (/var/task/sandbox-worker.js:21118:20)|
|12:45:10.315  |    at async mainSub (/var/task/sandbox-worker.js:20849:9)|
|12:45:10.315  |    at async main (/var/task/sandbox-worker.js:20711:5)|
|12:45:12.136  |Done with "package.json"|

I’ll take a look at the repos. Thanks guys!

2 Likes

Okay, today I have tried deploying untocuhed Frontity package to vercel and it worked. So, it seems we did something wrong but the question is what?

Update: my package is now almost identical to the mars theme but still getting the same error. :frowning:

I’ve added proper error handling to npx frontity build to be able to see what’s going on in the Vercel deployment: https://github.com/frontity/frontity/pull/550

As soon as this is merged we will release a new version.

2 Likes

Thank you. Can I try it on the dev branch? could you help me with the steps?

Not until we release a new version to npm but it shouldn’t take long.

1 Like