Newbie question here as I am just beginning game development with lime.js
, but I'm receiving this error below, and I for the life of me cannot figure out why this error says that 'moba.Bullet'
is already declared since I've only provided it once!
This is the full error:
Uncaught Error: Namespace "moba.Bullet" already declared.
goog.provide base.js:
(anonymous function)
When looking at the error's location in base.js, I am given this code:
goog.provide = function(name) {
if (!COMPILED) {
// Ensure that the same namespace isn't provided twice.
// A goog.module/goog.provide maps a goog.require to a specific file
if (goog.isProvided_(name)) {
throw Error('Namespace "' + name + '" already declared.');
}
}
I have only provided the namespace once! This makes this even more confusing!!
To understand this problem, it will help to see my file structure.
the folder structure of my lime.js game looks like so:
limejs >
moba >
moba.html
moba.js
bullet.js
bin >
lime.py
projects
external >
closure
box2D
and i even ran bin/lime.py update so moba.js (the main js file) would recognize bullet.js!
And now we get to how I call each file with goog.provide and goog.require.
moba.js >
goog.provide('moba');
goog.require('moba.Bullet');
bullet.js >
goog.provide('moba.Bullet');
Pretty standard, right?!
I'm not sure where to go from here. I've tried recreating the project through the command line but with no love. So please help and thanks for helping!
If you look at the first line you see the opening tag, then the second line for if (!COMPILED) has an opening tag, then on the fifth line is if (goog.isProvided_(name)) and another opening tag, but only two closing tags at the end of that code, I would think there should be a third one.