redotvideo / revideo

Create Videos with Code
https://re.video
MIT License
2.58k stars 87 forks source link

NextJS Page Router: SyntaxError: Cannot use import statement outside a module #331

Open jonathangerbaud opened 2 weeks ago

jonathangerbaud commented 2 weeks ago

Hello,

I've been trying to use Revideo from your NextJS starter template. And it works.

Problem is that I don't want to use NextJS App Router, I want to use the Page Router.

And when I do so, I always get the same error, whatever configuration I change:

SyntaxError: Cannot use import statement outside a module

So, I don't really know why it works in app router and not in the page router, all I know is that if I go to node_modules, and add "type": "module" in package.json for the player-react and core modules, it somehow clears the error (I got another one, but different one).

Can you make sure you're producing ESM packages so I can use NextJS Page Router?

justusmattern27 commented 2 weeks ago

I believe that this will be fixed with the upcoming release, #328 should fix it - is that right? @hkonsti