question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

url_prefix changed behaviour with 4.2.2

See original GitHub issue

I had Verdaccio 4.2.1 running behind an apache proxy working well and just tried upgrading to latest and it’s no longer working. Tracked the change in behaviour to 4.2.2.

I have the prefix configured in verdaccio’s config:

url_prefix: /npm/

Apache proxy config:

<Location /npm/>
    ProxyPass https://127.0.0.1:4873/ nocanon
    ProxyPassReverse https://127.0.0.1:4873/
    ProxyPreserveHost On
</Location>

With 4.2.1, this is working perfectly. Here’s a diff of the initial GET response from 4.2.1 and 4.2.2 out of Verdaccio itself (not apache):

--- good.4.2.1.txt      2019-10-16 15:20:18.931210851 +0100
+++ bad-4.2.2.txt       2019-10-16 15:19:44.480775891 +0100
@@ -15,12 +15,12 @@
         window.VERDACCIO_SCOPE = '';
         window.VERDACCIO_LOGO = '';
         window.VERDACCIO_PRIMARY_COLOR = '';
-        window.VERDACCIO_VERSION = '4.2.1';
+        window.VERDACCIO_VERSION = '4.2.2';
     </script>
-<link rel="shortcut icon" href="http://ukserver.activfinancial.com/npm/-/static/favicon.ico"><link href="http://ukserver.activfinancial.com/npm/-/static/0.style.026be7a5bc0c57143eb2.css" rel="stylesheet"><link href="http://ukserver.activfinancial.com/npm/-/static/2.style.92647ec0a7beb8b2898d.css" rel="stylesheet"></head>
+<link rel="shortcut icon" href="/-/static/favicon.ico"><link href="/-/static/0.style.2ea8a5d1276179958242.css" rel="stylesheet"><link href="/-/static/2.style.92647ec0a7beb8b2898d.css" rel="stylesheet"></head>
 
 <body class="body">
     <div id="root"></div>
-<script type="text/javascript" src="http://ukserver.activfinancial.com/npm/-/static/manifest.36047715e70284b71dcd.js"></script><script type="text/javascript" src="http://ukserver.activfinancial.com/npm/-/static/vendors.36047715e70284b71dcd.js"></script><script type="text/javascript" src="http://ukserver.activfinancial.com/npm/-/static/main.36047715e70284b71dcd.js"></script></body>
+<script type="text/javascript" src="/-/static/manifest.64e04f9f5e62cc8e0fd4.js"></script><script type="text/javascript" src="/-/static/vendors.64e04f9f5e62cc8e0fd4.js"></script><script type="text/javascript" src="/-/static/main.64e04f9f5e62cc8e0fd4.js"></script></body>
 
 </html>

As you can see, scripted sources are relative in 4.2.2. I can’t see anything in the changelog that would indicate a config change is required or what else might have caused this (maybe it should never have worked like I have it configured?).

A quick diff of the 4.2.1 and 4.2.2 tags shows few changes to verdaccio so I guess it’s one of the dependencies, but I’ve no idea where …

There are a few other issues referencing url_prefix, but they seem to predate 4.2.2 so presumably aren’t related. Apologies if this is just noise, but I am a bit stumped…

Regards

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:25 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
lukebelliottcommented, Oct 19, 2019

Sorry if it wasn’t clear from my previous message, I don’t think it’s anything to do with apache as I get the exact same behaviour with nginx on my server.

Also, since then, I managed to get docker-examples/reverse_proxy/nginx/relative_path running, and that shows the issue too if the location / section is removed.

With the default config from the example (location / still there), then you can see a bunch of requests don’t have the url_prefix. Here’s a quick summary of the URLs (as seen from the browser in this case):

… and so on …

Regards

5reactions
chrisbertrandsagecomcommented, Oct 22, 2019

I am experiencing the exact same problem. Only the favicon is correctly retrieved from the url_prefix. Everything else is served from root, which is not where the files reside. The favicon in the template uses: htmlWebpackPlugin.options.verdaccioURL to retreive the correct URL for the config.

image

I think it may be the rootURL in the env.js. https://github.com/verdaccio/ui/blob/master/config/env.js

The API is still working correctly and a comparison of the two shows they resolve this path differently. This looks to have changed in the UI here: https://github.com/verdaccio/ui/commit/6b5d0b7e2e37c4f0324b17b5794a01ebec49a71e#diff-8cc96276187f94a8094f05846514a3a7

Read more comments on GitHub >

github_iconTop Results From Across the Web

NEWS for R version 4.2.2 Patched (2022-12-14 r83470)
CHANGES IN R 4.2.2 patched. C-LEVEL FACILITIES: ... surprising Windows behavior with UTF-8 as the system encoding (PR#18382).
Read more >
Upgrading Ruby on Rails
In Rails 5.0, this behavior has changed to now inherit from ApplicationJob . When upgrading from Rails 4.2 to Rails 5.0, you need...
Read more >
Why is changing health-related behaviour so difficult? - PubMed
It is noted that most efforts to change health behaviours have had limited success. This paper suggests that in policy-making, discussions about behaviour...
Read more >
An overview of behaviour change models and their uses
By contrast, theories of change show how behaviours change over time, and can be changed. While behavioural theory is diagnostic, designed to explain...
Read more >
The behaviour change wheel: A new method for ...
Improving the design and implementation of evidence-based practice depends on successful behaviour change interventions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found