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

406
Visualizações
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 4 years ago · Juan Pablo Isaza
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