basic configuration: Error: url must be an URL address
See original GitHub issuehey 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:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
The problem is fixed with https://github.com/pmb0/express-sharp/commit/be9fbeb52b745a11572472b30518c7ac522e7515. A release will follow shortly.