0

I am making a meteorjs web app but the code within the meteorjs is based off of Angularjs. When I deploy the code locally, everything I want my code to do works, however, when I type "meteor deploy" in the terminal and put my web app online, all of the html I want to appear appears, but I get this error in the console:

Error: [$injector:unpr] Unknown provider: tProvider <- t

And none of my angularjs works anymore.

After doing some research as to what this error means, I think it has something to do with how I'm linking together the controllers for angular. This is what my main.js looks like:

import angular from 'angular';
import angularMeteor from 'angular-meteor';
import todosList from '../imports/components/todosList/todosList';
angular.module('simple-todos', [
  angularMeteor,
  todosList.name
]);

And inside of /imports/components/todoList, I have 2 files: todoList.js and todoList.html. All of the stuff from todoList.html loads, but I don't think anything from todoList.js is working. My todoList.js looks something like this:

import angular from 'angular';
import angularMeteor from 'angular-meteor';
import template from './todosList.html';
import { Data } from '../../api/tasks.js';

class TodoListCtrl {
  constructor($scope){
    'ngInject'
    //... declare a bunch of $scope variables
    //create a helper function to get data out of the Data db
  }
  //.. declare a bunch of functions
}

export default angular.module('todosList',[
  angularMeteor
])
  .component('todosList', {
    templateUrl: 'imports/components/todosList/todosList.html'
    controller: TodosListCtrl
  });

I'm not sure why I'm getting the "Error: [$injector:unpr] Unknown provider: tProvider <- t", but online it says it might be because the "$injector" is failing to resolve a required dependency. I feel like that shouldn't be the case, though, because my app works fine locally. Does anyone have any experience with this and know how to help?

Urigo
  • 3,175
  • 21
  • 27
Brian K
  • 548
  • 1
  • 4
  • 17

1 Answers1

0

This looks like a minification problem (probably in the way you declare a service somewhere in your code). In order to check that locally, try to use strictDi, here is an answer that specifies how to: https://stackoverflow.com/a/26734698/1426570

Community
  • 1
  • 1
Urigo
  • 3,175
  • 21
  • 27