Hi! I’m currently building a 3D multiplayer web game where my frontend consists of ES6 modules bundled with Webpack. My backend uses node with the experimental ES6 module compatibility.One of my modules is used by both the client and the server, as they both need a copy of the game.This module uses three.js, and the problem is that when I try to include three using import * as THREE from “three”, THREE is apparently undefined on my node server while it works properly on the client.On the other hand, when I try to include three.js using import THREE from “three”, the opposite happens. THREE is defined on the server properly, but on the client it is undefined...Why does this discrepancy occur and how can I make it so that my module can be used on both the client and my node backend?
Submitted July 25, 2020 at 12:18PM by santoso-sheep
No comments:
Post a Comment