Having trouble getting a simple three.js website up and running on a live server (a2 shared hosting). Node.js is installed, but the start up file main.js doesn't seem to be reading properly. Completely new to Node. Starting the server results in an error - feeling completely lost...
/home/blockc17/app/main.js:1
import './style.css';
^^^^^^^^^^^^^
SyntaxError: Unexpected string
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at Module.require (/opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-
scripts/node-loader.js:80:25)
at require (internal/modules/cjs/helpers.js:25:18)
at loadApplication (/opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-
scripts/node-loader.js:243:2)
at setupEnvironment (/opt/cpanel/ea-ruby27/root/usr/share/passenger/helper-
scripts/node-loader.js:214:2)
**Main.js imports**
import './style.css';
import * as THREE from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
// Setup
**package.json**
{
"name": "blockcb",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^2.8.0"
}
}
**Index.html HEAD**
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="module" src="./src/main.js"></script>
<title>BlockChain Bullies</title>
</head>
Apologies for the code overload. Any guidance on how to tackle this issue and get the app running would be greatly appreciated.
[file structure in Cpanel][1]
[1]: https://i.sstatic.net/lYiX7.png