Does the Error: Cannot read property 'flags' of undefined have a stacktrace? Could you provide it? It should point us to the problem.
Every single google search result on the first page points with for āError: Cannot read property āflagsā of undefinedā seems to point to a typescript or angular issue like this one or that one. Are you using TS in the project and are you sure that itās not a TS issue?
An internal param called flags is used by one of the libraries we use in the CLI, commander so I guess the problem may be there. Iām going to investigate.
Thanks @modyydom, I was able to reproduce the issue. The problem is caused by the TypeScript compiler interacting with react-slick in production mode.
I am not sure about the reason, but itās not a good idea to run the TypeScript compiler on frontity serve, so I have filed a bug to get rid of that: https://github.com/frontity/frontity/issues/355
Until we fix that issue, you can create a file that does the require itself and run that, like this:
Hi @prainua, thanks a lot for the feedback and sorry for the inconvenience this may have caused Weāve just bumped up the priority of this bug and it should be addressed in the coming weeks. Weāll keep track of it at the GitHub issue.
Hey @juanma. I am also facing this issue and I am totally stuck. I cant even figure out how to start debugging it.
npx frontity build completes without issue npx frontity serve fails with the following message:
donkokoć: ~/devs/JS/kh-frontity-theme [git:live]
$ npx frontity serve
Error: Cannot read property 'flags' of undefined
If you need help please visit https://community.frontity.org/.
Happens to me also on the live server, that is how I found the issue. I have made a github action that uses ssh to connect to server, pull from github, build the app and run npx frontity serve but it fails in the last step because of this error.
I have done all of this multiple times, unfortunatelly that didnāt bring me further. I also saw the other posts mentioning the same issue and they both have very different causes, thatās why I was wondering if I can somehow log more information or see the full stack.
I can provide a github repo, but its private. Can you give me your github user and I can add you?
Unfortunately we donāt provide support to private repositories.
Could you replicate your issue (only the portion of the code that provokes the issue) in a public repository (or codesandbox) so any member of the community (Frontity team included) can help you with your issue?
Could you run npx frontity info (Iād like to see if you are using any packages that might be causing this issue and what version of node youāre on)
thank you so much for coming back to me about this. I was already getting to start desperate.
Just to say a few things, also referring to @juanmaās answer.
I completely understand the situation and I donāt expect you guys to debug/fix my issue. It is however something that was suggested so I wanted to offer access to my repository.
This aside, all I wanted was to get some help with debugging this and getting to the bottom of it, as I am completely clueless how to find the issue in a situation where the error is so vague. I would love to find the solution, just some directions are needed