I’m new to using Frontity and was trying to develop my first website using it.
I know how to develop using React and I know how to fetch data from my WordPress backend.
Looking at the Frontity documentation, I read that you need to create the project with: npx frontity create my-app
.
Then go to the frontity.setting.js
configuration file and change state.source.url
with my local WordPress environment.
Finally, you launch the project using the npx frontity dev
command.
When I visit http://localhost:3000
(it opens automatically), I get this error on a white screen:
ModuleDependencyError: Can't import the named export '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' from non EcmaScript module (only default export is available)
at Compilation.reportDependencyErrorsAndWarnings (C:Web DevelopmentProgetti Personalifrontity-reactnode_moduleswebpacklibCompilation.js:1468:21)
at C:Web DevelopmentProgetti Personalifrontity-reactnode_moduleswebpacklibCompilation.js:1258:10
at AsyncSeriesHook.eval [as callAsync] (eval at create (C:Web DevelopmentProgetti Personalifrontity-reactnode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:15:1)
at AsyncSeriesHook.lazyCompileHook (C:Web DevelopmentProgetti Personalifrontity-reactnode_modulestapablelibHook.js:154:20)
at Compilation.finish (C:Web DevelopmentProgetti Personalifrontity-reactnode_moduleswebpacklibCompilation.js:1253:28)
at C:Web DevelopmentProgetti Personalifrontity-reactnode_moduleswebpacklibCompiler.js:672:17
at eval (eval at create (C:Web DevelopmentProgetti Personalifrontity-reactnode_modulestapablelibHookCodeFactory.js:33:10), <anonymous>:11:1)
at C:Web DevelopmentProgetti Personalifrontity-reactnode_moduleswebpacklibCompilation.js:1185:12
at C:Web DevelopmentProgetti Personalifrontity-reactnode_moduleswebpacklibCompilation.js:1097:9
at processTicksAndRejections (node:internal/process/task_queues:77:11)
I don’t know how to resolve this error.
I’ve tried everything:
-
Try creating the project again
-
Start without changing the URL in the config file (after a new creation)
-
Go to WordPress settings and set Permalinks to “Post Name”
-
Try changing
state.source.url
tostate.source.api
(as I read on the internet, but I don’t know if it’s reliable)
None of these tests seemed to lead to anything working.
Could anyone give me a hand resolving this strange error when i try to run my Frontity project?