Getting this error in 'npx frontity dev'

SERVER STARTED – Listening @ http://localhost:3000

  • mode: development
  • target: module

TypeError: libraries__WEBPACK_IMPORTED_MODULE_2_.Api is not a constructor
at wpSource (webpack-internal:///./node_modules/@frontity/wp-source/src/index.ts:6:925)
at eval (webpack-internal:///./node_modules/@frontity/core/src/utils/merge-packages.ts:7:360)
at Array.forEach ()
at webpack_exports.default (webpack-internal:///./node_modules/@frontity/core/src/utils/merge-packages.ts:7:173)
at webpack_exports.default (webpack-internal:///./node_modules/@frontity/core/src/server/store.ts:5:271)
at eval (webpack-internal:///./node_modules/@frontity/core/src/server/index.tsx:43:68)
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at eval (webpack-internal:///./node_modules/koa-mount/index.js:16:290)

TypeError: libraries__WEBPACK_IMPORTED_MODULE_2_.Api is not a constructor
at wpSource (webpack-internal:///./node_modules/@frontity/wp-source/src/index.ts:6:925)
at eval (webpack-internal:///./node_modules/@frontity/core/src/utils/merge-packages.ts:7:360)
at Array.forEach ()
at webpack_exports.default (webpack-internal:///./node_modules/@frontity/core/src/utils/merge-packages.ts:7:173)
at webpack_exports.default (webpack-internal:///./node_modules/@frontity/core/src/server/store.ts:5:271)
at eval (webpack-internal:///./node_modules/@frontity/core/src/server/index.tsx:43:68)
at processTicksAndRejections (internal/process/task_queues.js:89:5)
at eval (webpack-internal:///./node_modules/koa-mount/index.js:16:290)

This error is fixed after replace ‘@ frontity’ package from git.

Could you please indicate the steps to reproduce the problem?

yes sure!

:point_down:
npx frontity create my-app && cd my-app
npx frontity dev

that’s it

Could you please do npx frontity info in that folder?

ok doing it.

Ohh problem is still there after replacing from Git.

Sending npx frontity info in 5 mins

npx frontity info

Looking into it. Thanks @smit.soni22.

let me know if you need something else or even remote access of my mac.

It looks like it’s not a problem with Frontity itself, but with a dependency that has included a bug. We are trying to find out which one it is.

It’s this bug on the 7.5.0 version of babel which was released 3 hours ago: https://github.com/babel/babel/issues/10162

It looks like they broke the direct exports like this:

export { default as Api } from "./api";

We have changed them to make it work and we are releasing a new version as we speak.

We will change them back once they have fixed the issue.

Thanks!

Smit, can you update to [email protected] and let us know if it’s fixed?

It’s working after package update! :+1:

1 Like