Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

"Argument 'module' is not a function, got Object" when inject module dependencies #115

Open

Description

@fp-Kuba

I'm using webpack and ES6 module in angular 1.x app. In webpack.config I set:

resolve: {
    alias: {
      'angular': 'angular/angular',
      'angularFormly': 'angular-formly/dist/formly',
      'apiCheck': 'api-check/dist/api-check',
      'formlyAngularTemplatesBootstrap': 'angular-formly-templates-bootstrap/dist/angular-formly-templates-bootstrap'
    }
  }
module: {
    loaders: [
      { test: /angular/, loader: 'exports-loader?angular' },
      { test: /apiCheck/, loader: '!imports-loader?angular' },
      { test: /angularFormly/, loader: '!imports-loader?angular,apiCheck' },
      { test: /formlyAngularTemplatesBootstrap/, loader: '!imports-loader?angular,angularFormly' },
    ]
  },

Now in JS file create module:

import 'angularFormly';
import 'formlyAngularTemplatesBootstrap';

export const FormlyUtilityModule = angular
  .module('formly-utility', [
    'formly',
    'formlyBootstrap'
  ])
  .name;

Unfortunately I got error:

Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module formly-utility due to:
Error: [$injector:modulerr] Failed to instantiate module formlyBootstrap due to:
Error: [$injector:modulerr] Failed to instantiate module {"version":{"full":"1.5.8","major":1,"minor":5,"dot":8,"codeName":"arbitrary-fallbacks"},"callbacks":{}} due to:
Error: [ng:areq] Argument 'module' is not a function, got Object

Any ideas why 'formlyBootstrap' didn't works ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions