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

Errors installing Theseus on Brackets (sprint 38) #58

Closed
yelper opened this issue May 7, 2014 · 14 comments
Closed

Errors installing Theseus on Brackets (sprint 38) #58

yelper opened this issue May 7, 2014 · 14 comments

Comments

@yelper
Copy link

yelper commented May 7, 2014

Hi there,

I'm having issues installing Theseus for Brackets through the UI. I'm using Brackets (sprint 38 experimental build 0.38.0-12606 (release 4df8afdad)). The installation prompts a generic error in the Brackets UI, and shows in the extension list as having an 'extension error'.

The Brackets developer log has the following after downloading Theseus and trying to install. I'm new to both projects so I might be missing something simple, but the extra .js extensions seem suspect. The files (sans the .js extensions for the HTML pages) seem to be in the Theseus folder inside the extensions folder.

GET file://[windowsfileserver]/users$/[username]/AppData/Roaming/Brackets/extensions/user/theseus/package.json.js  require.js:1872
GET file://[windowsfileserver]/users$/[username]/AppData/Roaming/Brackets/extensions/user/theseus/src/InstallationCorrupt.html.js  require.js:1872
Uncaught Error: Script error for: package.json
http://requirejs.org/docs/errors.html#scripterror require.js:163
Uncaught Error: Script error for: src/InstallationCorrupt.html
http://requirejs.org/docs/errors.html#scripterror require.js:163
GET file://[windowsfileserver]/users$/[username]/AppData/Roaming/Brackets/extensions/user/theseus/src/Invitation.html.js  require.js:1872
Uncaught Error: Script error for: src/Invitation.html
http://requirejs.org/docs/errors.html#scripterror require.js:163
GET file://[windowsfileserver]/users$/[username]/AppData/Roaming/Brackets/extensions/user/theseus/src/NewVersionAvailable.html.js  require.js:1872
GET file://[windowsfileserver]/users$/[username]/AppData/Roaming/Brackets/extensions/user/theseus/src/InvalidVersion.html.js  require.js:1872
Uncaught Error: Script error for: src/NewVersionAvailable.html
http://requirejs.org/docs/errors.html#scripterror require.js:163
Uncaught Error: Script error for: src/InvalidVersion.html
http://requirejs.org/docs/errors.html#scripterror require.js:163
[theseus] fsm: -> waitingForApp fsm.js:35
[theseus] fsm: -> disconnected fsm.js:35
[Extension] failed to load //[windowsfileserver]/users$/[username]/AppData/Roaming/Brackets/extensions/user/theseus Error: Load timeout for modules: text!package.json_unnormalized2,text!src/InstallationCorrupt.html_unnormalized3,text!package.json,text!src/InstallationCorrupt.html,text!src/Invitation.html,text!src/NewVersionAvailable.html,text!src/InvalidVersion.html
http://requirejs.org/docs/errors.html#timeout /utils/ExtensionLoader.js:209
Uncaught RangeError: Maximum call stack size exceeded
@alltom
Copy link
Member

alltom commented May 8, 2014

They do seem suspect!

Unfortunately, I can't reproduce this with the same version of Brackets on OS X. I'll see if I can't find a computer with Windows.

@alltom
Copy link
Member

alltom commented May 8, 2014

@peterflynn and I tried on Windows and neither of us got an error. I tried on Windows 7. Which version of Windows are you using?

What kind of generic error do you see?

Are you installing from the Extension Manager? A ZIP file downloaded from the extension registry? GitHub? (It won't work from GitHub, but the other two should work.)

Have you installed Brackets from source? If so, perhaps your submodules are way out of date? (It might be that an old requirejs is misinterpreting the "text!" prefix for HTML files.)

@yelper
Copy link
Author

yelper commented May 8, 2014

Thank you both for taking a look at this!

With Brackets from the Sprint 38 .msi, I am installing Theseus from the package manager, which brings up the modal dialog while it downloads the extension:
theseus-install

I see this generic error after installing in the lab:
theseus-error

I was able to successfully install Theseus at home; maybe in the lab the user profile (%APPDATA%) being on a Windows File Share instead of locally causes a problem?.. but that would be strange since the files seem to be copied over okay (%APPDATA%/Brackets/extensions/user/theseus/). Do I need administrative permissions in order to install extensions?

@alltom
Copy link
Member

alltom commented May 8, 2014

How proficient are you at debugging JavaScript? Would you be able to:

  • Trace that "installation failed" message to the exception or failed promise that generated it? Or
  • Narrow down the cause for why ".js" is being appended to all the file names?

(assuming those aren't the same thing; maybe they are)

If not, I'll ping brackets-dev and see if anyone else has the means to reproduce your setup.

@peterflynn
Copy link

@yelper You might also try disabling all your other extensions to see if any of them are causing a problem.

It sure does sound like something is wrong with the RequireJS "text" plugin -- it basically appears to be getting ignored. Why that would be (and how it could happen without breaking the stuff in core that depends on it) is a mystery, though...

@yelper
Copy link
Author

yelper commented May 8, 2014

I'm not running any other extensions, unfortunately.

It seems to be a bug in RequireJS; in require.js (line 1612):

url += (ext || (/\?/.test(url) || skipExt ? '' : '.js'));

where it tries to convert a named resource to a URL, and a .js suffix is added to those files loaded as text (e.g. text!...). I couldn't immediately tell why this happens however (or what the correct behavor is). I tried adding dummy query strings to the places where text resources are loaded, to force the second condition above to be true (e.g. Invitation.js, line 34 with added ?junk):

var dialogHTML     = require("text!./Invitation.html?junk");

... but it didn't seem to help.

@peterflynn
Copy link

@yelper I don't think it should even be getting into nameToUrl() though -- the code in makeModuleMap() should be getting into the if (prefix) { case. Can you debug in makeModuleMap() and trace through the beginning part where splitPrefix() is called and prefix is calculated? Is the text! prefix not being seen?

@yelper
Copy link
Author

yelper commented May 9, 2014

I'm getting a little out of my element here, but I think I found the source of the error.

Since the resources are being loaded from a different server (user profile directory is on external server), the second fork of text.js (in load(), line 194) is taken, which subsequently calls req() with the stripped name (line 199, [nonStripName]), eventually calling makeModuleMap() with no prefix, so nameToUrl() is called that adds .js to the end of the resource names (below).

I'm not immediately clear what the next steps or how to solve this bug are. It doesn't seem to be an issue with this project anymore. :) Who owns text.js?

The fetching of the following files (all called originally with text! prefixes) fail because of this bug.

  • package.json
  • src/InvalidVersion.html
  • src/Invitation.html
  • src/InstallationCorrupt.html
  • src/NewVersionAvailable.html

Thanks for bearing through this! I appreciate it.

@peterflynn
Copy link

@yelper What values are you seeing to the arguments of useXhr() on that line? I would assume even if your user profile is mapped onto a network storage location, it will appear as part of the local filesystem -- so it would still be seen as a file: protocol by CEF when loading it.

@yelper
Copy link
Author

yelper commented May 10, 2014

There's probably a problem with the regular expression doing the matching (not being Windows-aware). However, both protocol and hostname have mis-matches in the return from useXhr(). A sample URL is //wfs1/users$/[username]/AppData/Roaming/Brackets/extensions/user/theseus/src/InstallationCorrupt.html.

  • uProtocol is an empty string, while protocol is file.
  • uHostName is wfs1, while hostname is an empty string

@alltom
Copy link
Member

alltom commented May 16, 2014

Great sleuthing! I recommend opening an issue on RequireJS and pointing them here. :)

@davidsearle
Copy link

@yelper Have you been able to find a solution for this? I have a few plugins that have the same issue, and I also have a network path for my AppData folder? Same problems as you when installing certain plugins.

Thanks,

David

@yelper
Copy link
Author

yelper commented Aug 7, 2014

I haven't found an solution yet, but I'm back on the hunt. I'll let you know what happens or feel free to follow!

@alltom
Copy link
Member

alltom commented Aug 7, 2014

Thanks for the heads up!

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

4 participants