-
Notifications
You must be signed in to change notification settings - Fork 455
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
React lite theme loader incorrectly resolves paths #2950
Comments
I'm seeing the same issue. Looking into it, it appears some paths (ie. |
This is actually expected behavior, since the client side has no knowledge about the server side js layout, so it has to try and see the result, does everything work correctly ignoring those logs? |
I just made a few changes to the loader and created a Pull Request (I redid the commit a few times and just realized that my # mentions were creating noise in this issue -- oops sorry): #2954 It does two things:
@bobzhang I don't know if those changes break your implementation, as I have not taken the time to fully understand each specific case, so I don't know if the PR is valid. I tested it in the boilerplate code that comes with the react-lite theme and it removes all the incorrect calls and the app still works fine. |
After reading through https://nodejs.org/docs/latest/api/modules.html#modules_all_together and http://npm.github.io/how-npm-works-docs/npm3/how-npm3-works.html I understand now that your implementation is correct and that my Pull Request is incorrect (I will cancel it). Since npm > 3 resolves paths depending on the "install order", it is impossible to predict where a package is actually located and the only way is to recursively try fetching each file. I only wish we could find a way that doesn't lead to so many errors in the console.. |
@bobzhang what about having the server inform the client about the packages paths, instead of having the client making guesses and trying requests until it works?
|
Note you can hide those logs in chrome devtools. I thought about it, but the added value seems not to justify its complexity which results in less reliability. Note maybe some of your patch can be employed to reduce such miss hit, for example: |
@bobzhang If this behavior will be the accepted norm, you may want to add some kind of warning on the blog/documentation for the package errors. I kind of assumed it was a bug or some kind of work in progress. Also thanks so much for your hard work! It's greatly appreciated! 🍻 Worth noting for future readers... You can filter the noisy logs easily by ignoring all network errors (at the expense of not seeing legitimate errors in the console area): You could also right click on each error and click "hide" but I think it might hide all errors from that file in the future which could be an issue for the |
Of course thank you for the great work @bobzhang , and the current implementation is a good move to rethink the developer experience, and to get rid of the overhead that webpack used to bring when used with reason. However, in my opinion, the current errors in the console are not "acceptable" in terms of developer experience, especially since reason has a strong focus in good DX, and even more since this attempt at removing webpack is, from what I understand, also meant to improve DX (by removing one more dependency and relying on an additional node process). The dev tools console is the main interface developers use to understand what goes on in their app, and I don't think it can be painted all red like this just to accommodate npm's non deterministic installation algorithm... @AdamBrodzinski : while I understand your recommendation to add notes in the documentation and your tips to filter the logs in the console, I don't see how this could become the norm and something everyone new to reason should be facing when trying it. @bobzhang maybe the loader can be improved by using the |
I think I might have found a problem with the path resolution. I'm trying to use |
We might close this issue because this template isn't available anymore 01abf6e And maybe open a new one or rename this one because
from the commit msg. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The new react-lite theme comes with its own loader.js file, but it seems that it incorrectly resolves many paths, as can be seen in the following screenshot:
The text was updated successfully, but these errors were encountered: