Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

257
Visualizações
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 Respostas
Responde à pergunta

0

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

yarn dev
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda