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

407
Views
Paquete web: error de compilación al realizar el tutorial de introducción

Obtención de un error de compilación al seguir el tutorial de Webpack en https://webpack.js.org/guides/getting-started/ .

Ya lo he revisado tres veces, una vez en la que escribí todo manualmente para evitar caracteres ocultos al copiar y pegar.

Ejecutándose en Powershell en Windows 10, Npm versión 8.3.0, Lodash versión 4.17.21, Webpack versión 5.66.0, Webpack-cli versión 4.9.1.

El mensaje de error es este:

 (base) PS C:\path\to\webpack-demo> npx webpack assets by status 291 bytes [cached] 1 asset ./src/index.js 458 bytes [built] [code generated] [1 error] WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment. You can also set it to 'none' to disable any default behavior. Learn more: https://webpack. js.org/configuration/mode/ ERROR in ./src/index.js 1:0 Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are confi gured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file) webpack 5.66.0 compiled with 1 error and 1 warning in 196 ms

Pegaré las líneas de código que tengo aquí, pero deberían ser idénticas a las del tutorial.

index.html :

 <!DOCTYPE html> <html> <head> <meta charset="uft-8" /> <title>Getting Started </title> </head> <body> <script src="main.js"></script> </body> </html>

index.js :

 import _ from 'lodash'; function component { const element = document.createElement('div'); element.innerHTML = _.join(['Hello', 'webpack'], ' '); return element; } document.body.appendChild(component());

package.json

 { "name": "webpack-demo", "version": "1.0.0", "description": "", "private": true, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "devDependencies": { "webpack": "^5.66.0", "webpack-cli": "^4.9.1" }, "dependencies": { "lodash": "^4.17.21" } }
about 4 years ago · Juan Pablo Isaza
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!