ravens-engine / core

A Javascript library for building multiplayer turn-based games
https://ravens.dev/
15 stars 2 forks source link

Tutorial error: Cannot use import statement outside a module #8

Open mrhappyasthma opened 3 years ago

mrhappyasthma commented 3 years ago
M:\src\server.js:1
import { Server } from "@ravens-engine/core/lib/server/index.js";
^^^^^^

SyntaxError: Cannot use import statement outside a module

It seems this can be resolved by adding "type": "module", manually to the package.json or using the .mjs file extension (source).

But it seems some recommended advice from searching around on google is to use require instead.

I'm not a web dev, so not sure what the recommended practice for ravens-engine is. But the tutorial should be updated to account for this, as I got quite stumped for a bit.