Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find variable when using jspm #138

Open
micaelmbagira opened this issue Mar 15, 2016 · 1 comment
Open

Can't find variable when using jspm #138

micaelmbagira opened this issue Mar 15, 2016 · 1 comment

Comments

@micaelmbagira
Copy link

I'm using jspm to load angular, when I run karma, I have Can't find variable: angular. This error is generated by the file generated by ng-html2js.
Here is my karma.conf :

module.exports = function (config) {
  const configuration = {
    browsers: [
      'PhantomJS'
    ],
    basePath: '../',
    singleRun: true,
    autoWatch: false,
    logLevel: 'INFO',
    junitReporter: {
      outputDir: 'test-reports'
    },
    frameworks: [
      'phantomjs-shim',
      'jspm',
      'jasmine'
    ],
    preprocessors: {
      [conf.path.src('**/*.html')]: [
        'ng-html2js'
      ]
    },
    ngHtml2JsPreprocessor: {},
    jspm: {
      config: 'jspm.config.js',
      loadFiles: [
        conf.path.src('app/**/*.js'),
        conf.path.src('**/*.html')
      ]
    },
    plugins: [
      require('karma-jasmine'),
      require('karma-junit-reporter'),
      require('karma-phantomjs-launcher'),
      require('karma-phantomjs-shim'),
      require('karma-coverage'),
      require('karma-ng-html2js-preprocessor'),
      require('karma-jspm')
    ]
  };

  config.set(configuration);
};

I tried to add angular to the paths lists and also to the files list but none worked.

@micaelmbagira
Copy link
Author

Actually I have this error when I add base/ prefix before conf.path.src('app/**/*.js'), in jspm.loadFiles.
When I don't add this, I have the following error : Potentially unhandled rejection [6] Error: XHR error (404 Not Found) loading http://localhost:9876/base/jspm_packages/npm/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant