Skip to content

Add route to generated source map for sockethub-client #521

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

Merged
merged 7 commits into from
Aug 25, 2021

Conversation

silverbucket
Copy link
Member

Resolves #486

@raucao can you verify this works for you?

@silverbucket silverbucket added this to the Core milestone Aug 16, 2021
@silverbucket silverbucket requested a review from raucao August 16, 2021 18:52
@silverbucket silverbucket self-assigned this Aug 16, 2021
@silverbucket silverbucket changed the title Add route for generates source map for sockethub-client Add route to generated source map for sockethub-client Aug 16, 2021
Copy link
Contributor

@raucao raucao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks llike there's a URL mismatch still (check the filename):

Source map error: Error: request failed with status 404
Resource URL: http://localhost:10550/sockethub-client.js
Source Map URL: client.js.map

@silverbucket
Copy link
Member Author

silverbucket commented Aug 17, 2021

@raucao OK, it's a bit of a hack but it should work now. I was able to strip away full path references, but have been unable to remove relative paths. So it specifies the path as js/sockethub-client.js.map even though the original JS file is served from /sockethub-client.js. I've added a second route, so it will serve the map from either / or /js/, and this works. Not pretty, but it works. :)

@silverbucket silverbucket requested a review from raucao August 17, 2021 12:26
@raucao
Copy link
Contributor

raucao commented Aug 18, 2021

I'm not sure what you're testing this with, but I still get the error:

Source map error: Error: request failed with status 404
Resource URL: http://localhost:10550/sockethub-client.js
Source Map URL: client.js.map

Do you not see the same? If you use Chrome, then it looks like this for example:

DevTools failed to load source map: Could not load content for http://localhost:10550/client.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

@silverbucket
Copy link
Member Author

silverbucket commented Aug 18, 2021

I'm not sure what you're testing this with, but I still get the error:

Source map error: Error: request failed with status 404
Resource URL: http://localhost:10550/sockethub-client.js
Source Map URL: client.js.map

Do you not see the same? If you use Chrome, then it looks like this for example:

DevTools failed to load source map: Could not load content for http://localhost:10550/client.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Weird, no I don't get this - I get the "Source Map Detected" alert in the devtools when inspecting the code for sockethub-client.js

@silverbucket
Copy link
Member Author

@raucao make sure you rm -rf packages/sockethub/dist first - there could be leftover files in there.

@silverbucket
Copy link
Member Author

@raucao any update on this? Making sure the old build files are gone should be the fix, because your error is referencing things that don't exist anymore. (client.js is no longer a file)

Copy link
Contributor

@raucao raucao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha: it seems I ran start instead of dev, thus using the old build. Sorry! I see it working now. 👍

@silverbucket silverbucket merged commit d8201c3 into master Aug 25, 2021
@silverbucket silverbucket deleted the add-source-map branch August 25, 2021 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable source maps for sockethub-client.js
2 participants