1
resposta

Erro no console, mesmo com tudo funcionando

Está tudo rodando certinho conforme as aulas, porem quando chega no console persiste o erro do "bundle.js" e no "system.js". Abaixo tem oq aprece no meu console:

Failed to load resource: the server responded with a status of 404 (Not Found)system.js:1

Failed to load resource: the server responded with a status of 404 (Not Found)dunble.js:1 

Failed to load resource: the server responded with a status of 404 (Not Found)system.js:1

Failed to load resource: the server responded with a status of 404 (Not Found)dunble.js:1 

Este são os meu códigos:

webpack.config.js

const path = require('path');
const babiliPlugin = require('babili-webpack-plugin');

let plugins = [];

if(process.env.NODE_ENV == 'production') {
    plugins.push(new babiliPlugin());
}
module.exports = {
    entry: './app-src/app.js',
    output: {
        filename: 'bundle.js',
        path: path.resolve(__dirname, 'dist'),
        publicPath:'dist'
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader'
                }
            }
        ]
    },
    plugins
}

Packpage.json

{
  "name": "client",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build-dev": "webpack --config webpack.config.js",
    "build-prod": "cross-env NODE_ENV=production webpack --config webpack.config.js",
    "start": "webpack-dev-server"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "reflect-metadata": "^0.1.13"
  },
  "devDependencies": {
    "babel-cli": "^6.24.1",
    "babel-core": "^6.25.0",
    "babel-loader": "^7.1.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2017": "^6.24.1",
    "babili-webpack-plugin": "^0.1.1",
    "cross-env": "^5.0.1",
    "webpack": "^3.1.0",
    "webpack-dev-server": "^2.5.1"
  }
}

Prompt de comando:

C:\Users\danie\Downloads\projeto-webpack\projeto-webpack\client>npm start

> client@1.0.0 start C:\Users\danie\Downloads\projeto-webpack\projeto-webpack\client
> webpack-dev-server

Project is running at http://localhost:8080/
webpack output is served from /dist
Hash: 3f4f996776d8858089ce
Version: webpack 3.1.0
Time: 1398ms
    Asset    Size  Chunks                    Chunk Names
bundle.js  362 kB       0  [emitted]  [big]  main
  [20] ./app-src/domain/negociacao/Negociacao.js 719 bytes {0} [built]
  [21] ./app-src/util/index.js 374 bytes {0} [built]
  [39] ./app-src/domain/index.js 186 bytes {0} [built]
  [42] ./app-src/domain/negociacao/NegociacaoDao.js 1.92 kB {0} [built]
  [46] multi (webpack)-dev-server/client?http://localhost:8080 ./app-src/app.js 40 bytes {0} [built]
  [47] (webpack)-dev-server/client?http://localhost:8080 5.59 kB {0} [built]
  [48] ./node_modules/url/url.js 23.3 kB {0} [built]
  [49] ./node_modules/punycode/punycode.js 14.7 kB {0} [built]
  [50] ./node_modules/url/util.js 314 bytes {0} [built]
  [54] ./node_modules/strip-ansi/index.js 161 bytes {0} [built]
  [56] (webpack)-dev-server/client/socket.js 856 bytes {0} [built]
  [88] (webpack)-dev-server/client/overlay.js 3.6 kB {0} [built]
  [94] (webpack)/hot/emitter.js 77 bytes {0} [built]
  [96] ./app-src/app.js 511 bytes {0} [built]
  [97] ./app-src/controllers/NegociacaoController.js 5.72 kB {0} [built]
    + 95 hidden modules
webpack: Compiled successfully.
1 resposta

Fala ai Daniel, tudo bem? Estranho, tem algum arquivo na aplicação chamado system.js? Talvez o erro seja de bibliotecas terceiras que as suas bibliotecas estão utilizando.

Ou até mesmo erro de alguma extensão do navegador ou o próprio navegador em si.

Espero ter ajudado.