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

Getting 404s on sourcemaps #67

Open
joshbedo opened this issue May 6, 2015 · 31 comments
Open

Getting 404s on sourcemaps #67

joshbedo opened this issue May 6, 2015 · 31 comments

Comments

@joshbedo
Copy link

joshbedo commented May 6, 2015

Recently with our builds we've been getting 404s on all of our sourcemaps. I tried clearing out .gobble, .gobble-build and also node_modules/.bin/gobble but haven't had any luck solving the problem. I saw another issue recently posted about sourcemaps and was wondering if it was related? Looking for any kind of help since we can't debug right now :)

@Rich-Harris
Copy link
Contributor

Sorry about this - yes, I'm fairly sure it's related. I just merged #66 which ought to fix it, I'm just tidying up a couple of other bits and pieces then I'll push a new version out, hopefully by the end of the day.

@Rich-Harris
Copy link
Contributor

@joshbedo I just released 0.10.0, which should fix this issue. Let me know if not, thanks

@Rich-Harris
Copy link
Contributor

Oh, and you'll probably want to npm install -g gobble-cli@latest while you're at it, otherwise some of the logging will look borked

@joshbedo
Copy link
Author

joshbedo commented May 6, 2015

So i just tried to upgrade and i'm having issues with peerDependency requirements. It says i need 0.7.1 for grunt-gobble. Any ideas or suggestions? Thanks!

@Rich-Harris
Copy link
Contributor

Ack, I struggle with npm's error messages. Have to dash out of the office right now so can't investigate, but does this article help any?

@evs-chris
Copy link
Contributor

You can manually edit the gobble-grunt package.json to have 'gobble": "^0" as a quick workaround.

@joshbedo
Copy link
Author

joshbedo commented May 6, 2015

Hey @evs-chris i tried what you suggested and i'm still get the same error.

@evs-chris
Copy link
Contributor

That's odd... is there more than one grunt-gobble in your node_modules tree? find . -name grunt-gobble or something like that from your project root should turn up any instances of grunt-gobble, and editing their package.json files should skirt the error. I wouldn't expect there to be more than one. What npm command are you running that's throwing the error?

@joshbedo
Copy link
Author

joshbedo commented May 6, 2015

So we only have one instance of grunt-gobble i modified its package.json to use ^0 and that seems to have fixed the npm install error. Now when building i'm getting this error.

@evs-chris
Copy link
Contributor

That sourcemap transform error should not be fatal. Does your project still serve correctly?

@joshbedo
Copy link
Author

joshbedo commented May 6, 2015

Yes it does, its just throwing the error on vendors on a few other areas.. not sure why or how to fix.. i've never seen an EMFILE error.

@joshbedo
Copy link
Author

joshbedo commented May 6, 2015

Although now i'm noticing sometimes it stops the build from finishing. So it doesnt always serve the page.

@Rich-Harris
Copy link
Contributor

Whoops, that EMFILE is probably happening because the update version of sander was using fs instead of graceful-fs. I've just fixed that and released a new version. If you remove gobble from node_modules and reinstall it, it'll get the latest sander and you should no longer see that error.

Also, if you npm install -g [email protected] you'll get slightly nicer logging

@joshbedo
Copy link
Author

joshbedo commented May 7, 2015

So i'm still getting a similar error after upgrading :\

@Rich-Harris
Copy link
Contributor

Is the build failing as a result? ENOENTs should be harmless (they do need better logging admittedly, it looks positively alarming when you see them like that), in theory it'll just skip those files

@aubergene
Copy link

I'm getting this message too, the build is fine, just the sourcemap isn't generated. gobble-cli version 0.4.2

gobble: server listening on port 4567
gobble: livereload server running
gobble: 01-sass done in 56ms
gobble: 02-merge done in 5ms
∙∙∙∙∙∙∙ processing sourcemaps
gobble: ENOENT, open '/Users/aubergene/code/tmp/gobble-test/.gobble/main.css.map'
>>>
Error: ENOENT, open '/Users/aubergene/code/tmp/gobble-test/.gobble/main.css.map'
    at Error (native)
<<<

gobble: processed sourcemaps in 14ms
gobble: build completed in 83ms. Listening for changes...

@Rich-Harris
Copy link
Contributor

@aubergene can you share your gobblefile (or at least the bit with sass and the subsequent merge)? That's a weird place for it to be looking for the sourcemap, which makes me wonder if it's getting confused with relative paths or something.

Aaaand now that I look at @joshbedo's screenshot again, it looks like it's exactly the same problem. Are you using sass as well Josh?

@Rich-Harris
Copy link
Contributor

Ah, I've found the problem. gobble-sass was generating a sourcemap without understanding where it was writing the actual CSS file to, so the relative path was getting messed up. Not a problem with gobble itself (though it was a recent update to gobble that exposed the problem) - will have a fix released shortly

@Rich-Harris
Copy link
Contributor

I've just released [email protected], which ensures the relative sourcemap path is relative to the right thing. I also updated gobble itself, which contains a couple of small fixes related to CSS sourcemap URLs.

@joshbedo
Copy link
Author

joshbedo commented May 7, 2015

Hmm it seems like after upgrading im still getting the same error.

@joshbedo
Copy link
Author

joshbedo commented May 7, 2015

Not as many errors though, only three this time! 👏 One looks really weird, i think its because of bower components. Also thanks so much for the help!

@Rich-Harris
Copy link
Contributor

Those are weird errors - the 'cannot call method 'trace' of undefined', 'unexpected end of input' and ENOENT on jquery/)(.*) are particularly concerning. I don't suppose you're in a position to share the repo, or a stripped-down version that reproduces those errors?

@joshbedo
Copy link
Author

joshbedo commented May 7, 2015

Its a really large repo, i can share the structure and bower/package.json file? What would be the most helpful?

@Rich-Harris
Copy link
Contributor

If you can put gobblefile.js, [bower|package].json, and a bare-bones app folder, maybe with a couple of .js, .coffee and .es6.js files in app/assets, that ought to do the trick. Thanks!

@aubergene
Copy link

I updated gobble and gobble-sass and it ran without errors, thanks! However the sourcemap is generated with the wrong path, so it doesn't work in the browser, the output was "sources":["../.gobble-build/02-merge/1/main.scss"].

@Rich-Harris
Copy link
Contributor

@aubergene There's an open issue for that - #69 - basically, as far as node-sass is concerned, the source file is 02-merge/1/main.scss, and we need to jump through some hoops to trace it back to the actual file. It should still work though, because the sourcesContent is populated:

screen shot 2015-05-08 at 2 53 20 pm

screen shot 2015-05-08 at 2 55 13 pm

Are you not seeing the main.scss in devtools?

@aubergene
Copy link

I only see main.css, even though sourcesContent is in the sourcemap and looks correct. Here's the example repo I've been playing with https://github.com/aubergene/gobble-example

@Rich-Harris
Copy link
Contributor

Do you have CSS sourcemaps enabled in devtools? Your repo works for me... You need to check this box:

screen shot 2015-05-11 at 9 33 01 am

Also, I released a new version of gobble-sass which upgrades to the just-released node-sass v3.0.0

@aubergene
Copy link

Yep, it's enabled. It works fine on both my work machines, so it's probably something odd with my settings on laptop. I think it's fine to close this ticket. Thanks!

@Rich-Harris
Copy link
Contributor

It works fine on both my work machines

computers ¯\ _ (ツ) _ /¯

Will leave this open for the time being, for @joshbedo

@joshbedo
Copy link
Author

Sorry i havent had a chance to post the files, i'll try to post something tonight.

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