perfect-paca icon indicating copy to clipboard operation
perfect-paca copied to clipboard

image and font cannot display on server side

Open hugoinperson opened this issue 7 years ago • 4 comments

Hi, I've used integrated some UI library and find out the icon couldn't be displayed. I got this in chrome. screen shot 2017-11-11 at 1 56 37 pm

After investigating a while, actually the image files I put in "/assets" can't be displayed either. It's all fine on local server. I was guessing the loaders not working but not really sure what's the cause.

hugoinperson avatar Nov 11 '17 20:11 hugoinperson

use the nuxt static directory, which is designed for this sort of thing

https://nuxtjs.org/guide/assets#static

note that I'll be updating this to use nuxt.js 1.0 soon-ish as well

phlogisticfugu avatar Jan 09 '18 23:01 phlogisticfugu

@phlogisticfugu Why use static? Webpack should load them from the assets path if they are required. Static is only for when you need to have a specific url on the server, such as robots.txt (as per doc you linked)

qm3ster avatar Feb 13 '18 11:02 qm3ster

it's look like when I push code to AWS , it can't return correct document type

image

It's should be image , but document ...

SVG file is working , but jpg , png can't display .

ausir0726 avatar May 04 '18 01:05 ausir0726

you might need plugins like serverless-apigw-binary or serverless-apigwy-binary to serve images via serverless

afifsohaili avatar May 04 '18 03:05 afifsohaili