The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
sorry for this but it is really critical as the site have to be working and we are blocked by this issue.
there is a deadline and we are about to miss it
thank you very much and sorry again for this.
mmczaplinski6
Hi @modyydom! Sorry for the stress!
2 questions for you:
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.
luisherranz10
Iāve just started a fresh project on Windows 10 and it works fine.
Things you can try:
Search for ".flags" in your code. Make sure the error is not in your code.
Run npx frontity dev -p and check if you see any error in your code that only happens in production mode.
Try with both npm run dev or npx frontity dev to see if it makes a difference.
If the problem persists, check the version of commander with:
npm ls | find "commander"
I am running 2.20.3 here and it works fine here in Windows 10.
modyydom11
I found the cause of the problem
it is due to importing react-slick
I found also this behavior
The site is WORKING well in these situations:
On Zeit now server
With npx frontity dev
With npx frontity dev -p
When running npx frontity serve AFTER npx frontity dev
The site is NOT working in these situations:
When running npx frontity serve AFTER npx frontity build
When running npx frontity serve AFTER npx frontity dev -p
I donāt know what in zeit now that makes it working that is not in the npx frontity build
Iām sorry again for being so late and I really thankful of your efforts in helping me
luisherranz12
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:
please fix this problem
i can not deploy this on Now.
SantosGuillamot19
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 /.
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?