• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

292
Vistas
Module 'myApp' is not available in AngularJS with Webpack

I'm new to AngularJS. Instead of using script tags for dependency imports, I have installed the dependency using npm and then bundled it into one file using Webpack and I have imported that only. But I'm seeing this error.

bundle.js:2 Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to:
Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.4.4/$injector/nomod?p0=myApp

It seems angularjs is somehow unable to locate myApp module. See my code below.

app.js

'use strict';
import angular from 'angular';
angular.module( 'myApp', []);

index.js for bundling using webpack(these dependencies are installed using npm)

import 'angular';
import 'angular-route';
    
import './app/app.js';

index.html

<!DOCTYPE html >
<html lang="en" ng-app="myApp">

<head>
  <title>My App</title>
</head>

<body>
  ...

  <!-- Angular -->
  <script src="dist/bundle.js"></script>

</body>

</html>
about 3 years ago · Juan Pablo Isaza
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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda