Reputation: 1
import Paddle from './paddle';
let canvas = document.getElementById('gameScreen');
let ctx = canvas.getContext('2d');
const GAME_WIDTH = 800;
const GAME_HEIGHT = 600;
ctx.clearRect(0,0,800,600);
let paddle = new paddle(GAME_WIDTH, GAME_HEIGHT);
Paddle.draw(ctx);
Upvotes: 0
Views: 35
Reputation: 5205
As pointed by @Patric Evans in the comment, you need to set the type of script to module inside the script tag:
<script type="module" src="yourFile.js"></script>
Upvotes: 1