Skip to content
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

fix: og-image is not accessible in the production environment #361

Closed
zzy-life opened this issue Nov 25, 2024 · 5 comments
Closed

fix: og-image is not accessible in the production environment #361

zzy-life opened this issue Nov 25, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@zzy-life
Copy link

๐Ÿ› The bug

/og-image/image/og.png
500 Abnormal
image

๐Ÿ› ๏ธ To reproduce

https://www.webarcx.com/__og-image__/image/og.png

๐ŸŒˆ Expected behavior

Can display normally

โ„น๏ธ Additional context

#266 #252 #350

@zzy-life zzy-life added the bug Something isn't working label Nov 25, 2024
@zzy-life
Copy link
Author

0|NuxtAppName | [nuxt] [request error] [unhandled] [500] Cannot find module '@resvg/resvg-js-linux-x64-gnu'
0|NuxtAppName | Require stack:
0|NuxtAppName | - /www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/js-binding.js
0|NuxtAppName | - /www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/index.js
0|NuxtAppName | [Vue Router warn]: No match found for location with path "/og-image/image/og.png"
0|NuxtAppName | [Vue Router warn]: No match found for location with path "/og-image/image/og.png"
0|NuxtAppName | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
0|NuxtAppName | Error: Cannot find module '@resvg/resvg-js-linux-x64-gnu'
0|NuxtAppName | Require stack:
0|NuxtAppName | - /www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/js-binding.js
0|NuxtAppName | - /www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/index.js
0|NuxtAppName | at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
0|NuxtAppName | at Module.Hook._require.Module.require (/www/wwwroot/nodejs/node-v20.12.2-linux-x64-glibc-217/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:81:25)
0|NuxtAppName | at require (node:internal/modules/helpers:179:18)
0|NuxtAppName | at Object. (/www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/js-binding.js:1:3488)
0|NuxtAppName | at Module._compile (node:internal/modules/cjs/loader:1369:14)
0|NuxtAppName | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
0|NuxtAppName | at Module.load (node:internal/modules/cjs/loader:1206:32)
0|NuxtAppName | at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
0|NuxtAppName | at Module.require (node:internal/modules/cjs/loader:1231:19)
0|NuxtAppName | at Module.Hook._require.Module.require (/www/wwwroot/nodejs/node-v20.12.2-linux-x64-glibc-217/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:101:39)
0|NuxtAppName | [nitro] [unhandledRejection] Error: Cannot find module '@resvg/resvg-js-linux-x64-gnu'
0|NuxtAppName | Require stack:
0|NuxtAppName | - /www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/js-binding.js
0|NuxtAppName | - /www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/index.js
0|NuxtAppName | at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
0|NuxtAppName | at Module.Hook._require.Module.require (/www/wwwroot/nodejs/node-v20.12.2-linux-x64-glibc-217/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:81:25)
0|NuxtAppName | at require (node:internal/modules/helpers:179:18)
0|NuxtAppName | at Object. (/www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/js-binding.js:1:3488)
0|NuxtAppName | at Module._compile (node:internal/modules/cjs/loader:1369:14)
0|NuxtAppName | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
0|NuxtAppName | at Module.load (node:internal/modules/cjs/loader:1206:32)
0|NuxtAppName | at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
0|NuxtAppName | at Module.require (node:internal/modules/cjs/loader:1231:19)
0|NuxtAppName | at Module.Hook._require.Module.require (/www/wwwroot/nodejs/node-v20.12.2-linux-x64-glibc-217/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:101:39) {
0|NuxtAppName | code: 'MODULE_NOT_FOUND',
0|NuxtAppName | requireStack: [
0|NuxtAppName | '/www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/js-binding.js',
0|NuxtAppName | '/www/wwwroot/nodejs/html/.output/server/node_modules/@resvg/resvg-js/index.js'
0|NuxtAppName | ]
0|NuxtAppName | }

@harlan-zw
Copy link
Owner

Hi, it's likely that you have built your app in an environment different than you're hosting it. You can get around this be explicitly requiring @resvg/resvg-js-linux-x64-gnu or by deploying in a CI that matches the same environment.

@zzy-life
Copy link
Author

Hi, it's likely that you have built your app in an environment different than you're hosting it. You can get around this be explicitly requiring @resvg/resvg-js-linux-x64-gnu or by deploying in a CI that matches the same environment.

Can I specify the environment of @resvg/resvg-js-linux-x64-gnu? For example, can I specify to build the linux-64 version when building on windows?

@harlan-zw
Copy link
Owner

Seems like this is possible:

Let me know how you go I can update the docs

@zzy-life
Copy link
Author

Seems like this is possible:

Let me know how you go I can update the docs

pnpm add @resvg/resvg-js-linux-x64-gnu
It's normal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants