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.

basic configuration: Error: url must be an URL address

See original GitHub issue

hey there,

thank you very much for your work!

I got a problem with a very simple configuration:

const sellerProductUploadDirectory = path.join(__dirname, '../upload/sellerProductImage');
app.use(express.static(sellerProductUploadDirectory));
app.use(
  '/upload/sellerProductImage',
  expressSharp({
    imageAdapter: new FsAdapter(sellerProductUploadDirectory),
  })
);

When trying to access the page i get the following for some images and not all:

node_1      | GET /upload/sellerProductImage/I8bKvIgxn-_default-product.jpg.jpg 400 30.998 ms - 261
node_1      | Error: url must be an URL address
node_1      |     at /backend/node_modules/express-sharp/src/middleware/validator.middleware.ts:21:14

This url seems to be fine: http://localhost:8080/upload/sellerProductImage/FrGn0UIUI-fernando-meloni-va6b5ag3Jvo-unsplash.jpg.jpg

This url is not working: http://localhost:8080/upload/sellerProductImage/i6va5p7dE-1060-536x354-blur_2.jpg.jpg

When i remove the middleware, both images work without a problem.

Any help would be appreciated!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
pmb0commented, Sep 20, 2020

It turned out that the validation library used in the background caused the problems. I replaced it by now with another mechanism.

The problem is now fixed in v4.2.12.

2reactions
pmb0commented, Sep 20, 2020

The problem is fixed with https://github.com/pmb0/express-sharp/commit/be9fbeb52b745a11572472b30518c7ac522e7515. A release will follow shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: The STS URL MUST be provided in the configuration ...
Describe the bug I am setting the .well-known endpoint but not the STS. Everything works fine but the error is thrown in the...
Read more >
Error: [$http:badreq] Http request configuration url must be a ...
I upgraded my angular to 1.5 and i am getting this error. Here is the code which is inside my controller var reportURL...
Read more >
Configure a URL (Report Server Configuration Manager)
Configuring the URLs is mandatory if you installed Reporting Services in "files-only" mode (that is, by selecting the Install but do not ...
Read more >
Diagnosing base URL configuration problems
If an error related to base URL mismatch occurs, there may be no indication of a problem while performing an operation in the...
Read more >
Creating and managing Lambda function URLs
For more information about these configuration parameters, see CreateFunctionUrlConfig in the API reference. Note. To create a function URL via the AWS ...
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