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

Brackets won't load -- PathUtils is undefined #604

Open
O-kasso opened this issue Feb 22, 2017 · 9 comments
Open

Brackets won't load -- PathUtils is undefined #604

O-kasso opened this issue Feb 22, 2017 · 9 comments

Comments

@O-kasso
Copy link

O-kasso commented Feb 22, 2017

When attempting to load the editor either as part of Thimble, or directly at http://localhost:8000/src/hosted.html, get this exception:

Uncaught TypeError: Cannot read property 'directory' of undefined
    at Object.<anonymous> (:8000/src/utils/BrambleExtensionLoader.js:14)
    at Object.execCb (require.min.js:29)
    at Z.check (require.min.js:18)
    at Z.enable (require.min.js:23)
    at Z.init (require.min.js:17)
    at E (require.min.js:14)
    at Object.completeLoad (require.min.js:28)
    at HTMLScriptElement.onScriptLoad (require.min.js:29)

Undefined here should be PathUtils from thirdparty/path-utils/path-utils

My master branch and all submodules are synced with upstream at time of writing, and I performed the necessary npm install and npm start. Also tried troubleshooting steps found here. I've tried nuking and recloning to no avail :(

  • macOS Sierra 10.12.2, checked both Chrome and Firefox
  • Brackets commit 2888cfb

cc @humphd @gideonthomas

@O-kasso
Copy link
Author

O-kasso commented Feb 22, 2017

@humphd
Copy link

humphd commented Feb 23, 2017

cc @Pomax

I spent a bunch of time on this with @O-kasso today, and I couldn't make any sense of it. I'll try again tomorrow, but I'd appreciate any help people could give here. Something doesn't make sense, and I suspect the environment, a tooling version issue, or something else like that.

The line that's throwing here is this:

https://github.com/mozilla/brackets/blob/master/src/utils/BrambleExtensionLoader.js#L12-L14

When I updated to Adobe's latest upstream code, we pulled in changes that altered the way the PathUtils module gets done, in particular, requiring a submodule change. When I first talked with @O-kasso, it was odd because the version of the submodule was not what it should have been, as though git was at fault somehow. Manually fixing it didn't seem to alter things, nor did a fresh clone. All of this leads me to conclude that there is something in the the environment vs. code, but I'm not sure what.

@Pomax
Copy link

Pomax commented Feb 23, 2017

hm, I don't run into this myself on the latest commit (2888cfb)... did you two try a "clone --recursive" in a different dir, with "git submodule update --init --recursive" after cloning, followed by npm install? I noticed gyp complaining about python 3 but that's apparently completely inconsequential, npm run build and npm start still work

@O-kasso
Copy link
Author

O-kasso commented Feb 23, 2017

Finally fixed it! Not really sure how I got into this scenario, but this fixed it for me:

git submodule update --init --recursive
git submodule foreach --recursive git fetch
git submodule foreach git merge origin master

What's confusing me is that path-utils isn't even one of the submodules that changed:

	modified:   src/bramble/thirdparty/EventEmitter (new commits)
	modified:   src/extensions/default/JSLint/thirdparty/jslint (new commits)
	modified:   src/extensions/default/brackets-paste-and-indent (new commits)

@O-kasso
Copy link
Author

O-kasso commented Feb 23, 2017

@humphd should I close this issue?

@humphd
Copy link

humphd commented Feb 23, 2017

The only new thing here is the inclusion of --recursive in your git submodule update invocation. I notice that this seemed to trigger src/extensions/default/brackets-paste-and-indent to get touched.

I think we should use this as an opportunity to update the README to include a section on how to update your tree:

# Pull new commits from Mozilla (assuming your mozilla/brackets repo is named 'upstream')
git checkout master
git pull upstream master
# Brackets uses a lot of submodules, make sure they are all there and up-to-date
git submodule update --init --recursive
# Deal with any new modules in Brackets or extensions
npm install
# Rebuild dist/* and dist/bramble.js (Bramble Client API)
npm run build

@O-kasso would you be willing to do that?

@O-kasso
Copy link
Author

O-kasso commented Feb 23, 2017

@humphd sure thing, will update tonight

@Pomax
Copy link

Pomax commented Feb 23, 2017

Note that git submodule foreach git merge origin master technically makes you get different things than what brackets actually needs, by forcing the code into a state more recent than the versions pegged by the submodule entries, so your files might not actually reflect what the code is supposed to be now =)

(worst case, a submodule's master is a major version ahead of what brackets expected, and this introduces a new issue that prevents brackets from loading properly)

@O-kasso
Copy link
Author

O-kasso commented Feb 24, 2017

README update can be found here: #610

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

No branches or pull requests

4 participants