Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
import './style.css'; and SyntaxError: Unexpected string when setting up three.js & node.js on live server

Im struggling to get a simple three.js website running on a live server (a2 shared hosting). Ive installed node.js. The start up file is main.js but it doesn't seem to be able to read it. Im completely new to working with Node. When I start the server I get this error. Im totally 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>

Forgive me for dumping so much code. Im not sure of the best way to even approach this issue. Can anyone give me guidance on how to get this app running?

[file structure in Cpanel][1]


[1]: https://i.stack.imgur.com/lYiX7.png
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you need use vite to process the css import. just run

yarn dev
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!