Error: Unexpected token 'export'

Hello Frontity team,

After upgrading frontity to 1.10.0 when i run npx frontity dev i get

Error: Unexpected token ‘export’

I use npm version 6.13.6 and node version 12.16.1

I also tried to downgrade frontity to the previous version i used, but still get this error.
Here the repository:

Will be thankful for any help.

Best,
Dejan

Hey @dejangeorgiev :wave:

I think what might have happened is that you have manually updated frontity to ^1.10.0 in the package.json and then ran npm install. This gave you the new version of frontity but because of the package-json.lock file the dependencies like @frontity/core were not updated!

We have recently merged a change in https://github.com/frontity/frontity/pull/501 which removed a feature from frontity and moved it to frontity/core. So, you got the new version of frontity without the feature, but you haven’t installed the new version of @frontity/core where we moved it.

If you delete the package-lock file and the node_modules and re-run npm install, your project will run successfully :slightly_smiling_face:

In the meantime, we’re gonna have a look if the dependency version mismatch is something that we can improve on our side

1 Like

@luisherranz Mentioning you because you might be interested.

I think this is a use case we didn’t think of. That users can just upgrade frontity and expect it to work. @frontity/core is not a dependency of frontity because we want to keep frontity lightweight and the users might end up with a package version mismatch like how it happened here.

@juanma I mention you here in case that it’s that something that should be more prominent in the docs. By that I mean that frontity is a modular framework that is composed of packages that need to be updated together.

We could add @frontity/core as a peerDependency of frontity.

We could get rid of @frontity/core and merge it with frontity, but I don’t think it’s a good idea because of the way react-easy-state works: it needs to be added present only once. Making it a dependency of @frontity/core (which is guaranteed to be added only once at the root project level) ensures it. This was that fix: https://github.com/frontity/frontity/pull/329

Yeah, I think peerDependencies is the way to go in that case :+1:

Hey @mmczaplinski

Well, i tried with npm i frontity@latest.

Thank you very much for provide this solution. It works fine!

Best,
Dejan

1 Like

I’ve done a PR: https://github.com/frontity/frontity/pull/516

2 Likes

It just occurred to me that if this is not enough, we can check the @frontity/core version each time npx frontity dev runs and instruct the user to update it.