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

Error when trying to access website after installation #60

Open
pozzen opened this issue Aug 22, 2019 · 8 comments
Open

Error when trying to access website after installation #60

pozzen opened this issue Aug 22, 2019 · 8 comments
Assignees
Labels

Comments

@pozzen
Copy link

pozzen commented Aug 22, 2019

After having followed the instructions outlined in Manual Installation & Upgrades, I am greeted with the following error message when opening the website in Firefox:

Error: [$injector:modulerr] Failed to instantiate module phpdraft due to:
[$injector:modulerr] Failed to instantiate module phpdraft.env due to:
[$injector:nomod] Module 'phpdraft.env' 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.


https://errors.angularjs.org/1.7.5/$injector/modulerr?p0=php…AL%40http%3A%2F%2F192.3.162.10%2Fjs%2Fvendor.js%3A1%3A696%0A vendor.js:2:836

I would appreciate any help in solving this issue, as I'm not familiar with Angular.

@mattheworres
Copy link
Owner

Hmm, I was planning on doing some work on Hootdraft tonight, but I believe the specific module its complaining about (phpdraft.env) is specifically related to config.js, which provides a few variables for the frontend app. I'll take a peek at the instructions and see if I can't figure out where you fell (and fix the instructions) and help you figure this out, but at the moment I'm unable to peek at it.

@mattheworres
Copy link
Owner

So phpdraft.env not existing is directly from js/config.js not being included in your file system someway. Can you verify that it exists and is being loaded when you attempt to load the site in Firefox?

@pozzen
Copy link
Author

pozzen commented Aug 29, 2019

Opening http://[ip_address]/js/config.js loads a file with this content:

(function(angular, undefined) {
  angular.module("config", [])

.constant("ENV", {
  "apiEndpoint": "https://[domain]/api",
  "recaptchaPublicKey": "recaptcha_public"
})

;
})(angular);

I'm not sure whether the fact that I'm trying to access it using the IP address and not the hostname (the domain not being setup yet) makes any difference.

@mattheworres
Copy link
Owner

Interesting - that looks like code from a slightly older build, can you tell me which release you downloaded the ZIP from?

@pozzen
Copy link
Author

pozzen commented Aug 29, 2019

The 2.3.1 release. I will try 2.3.2 today.

@mattheworres
Copy link
Owner

That's quite bizarre, at least the copies of the ZIPs that I have locally, neither have the older version of config.js. I checked the "Download Source Code" link (ignore that and use the specific ZIP file as it contains some compiled code) and it didn't even have js/config.js (makes sense - it's not checked into source in Git).

I'm a bit baffled by what you're coming across here, but hopefully if you try this file: https://github.com/mattheworres/hootdraft/releases/download/2.3.2/HootDraft_2.3.2_Hotfixes.zip and hopefully this issue just goes away. Let me know what you find!

@mattheworres
Copy link
Owner

Ah, nope! There's an older copy of config.js.ci hanging out in the code that needs updated. Give me a bit and I can figure out what that update needs to be, but that's the issue you have - when running through the setup you're pulling that in.

@mattheworres
Copy link
Owner

mattheworres commented Aug 29, 2019

To temporarily fix the issue, change the contents of /deploy/config.js.ci to this:

(function(angular, undefined) {
  angular.module("phpdraft.env", [])

.constant("ENV", {
  "apiEndpoint": "{phpdraft.apiBaseUrl}",
  "recaptchaPublicKey": "{phpdraft.recaptchaPublicKey}"
})

;
})(angular);

(change angular.module("config" to angular.module("phpdraft.env")

And if you've already exported your settings and don't want to run through the text based setup wizard again, go update your stashed copy of config.js with the text change outlined above (or manually edit js/config.js too)

Sorry about that, I'll get that fixed and a new release published soon.

@mattheworres mattheworres self-assigned this Aug 29, 2019
mattheworres added a commit that referenced this issue Jan 16, 2020
Specifically if you've run the setup wizard on 2.3.1 or 2.3.2, even after
this change you'll need to either re-run the setup wizard (kind of a pain),
or manually go find and update js/config.js in your predefined settings
directory.
mattheworres added a commit that referenced this issue Jul 3, 2021
Specifically if you've run the setup wizard on 2.3.1 or 2.3.2, even after
this change you'll need to either re-run the setup wizard (kind of a pain),
or manually go find and update js/config.js in your predefined settings
directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants