hi @mburridge
When i run npx frontity build
i get this:
But when i run npx frontity serve
i get this error:
Thanks.
hi @mburridge
When i run npx frontity build
i get this:
But when i run npx frontity serve
i get this error:
Thanks.
Hmm - do you have a repo we can clone?
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.
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.json
s 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
npx frontity info
and paste the result here?Hello @luisherranz
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
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.
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!
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.
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.
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.
I can see, it’s now in the review section of current sprint, any ETA would you like to provide? or help with any workaround?
Update:
It got merged now. So, ETA for the new npm version release?
Okay, I found the issue. In my case it was the use of wrong file name “Post” instead of “post” while importing the Post component. It worked fine on my system because I’m using the Windows OS and file names are the Windows file system isn’t case sensitive, so it treats these Post and post as the same files. But on the other hand, Vercel uses Linux, and the file system is case sensitive and post.js and Post.js are different files for it. So, it tried to find Post.js which wasn’t exist and as a result it thrown the error.
@dejangeorgiev you had the smilair issue where you were trying to import component from author instead of the Author. I have created a pull request with fix for you.