Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

255
Vistas
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 Respuestas
Responde la pregunta

0

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

yarn dev
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda