nuxt-og-image 2.0.0-beta.24 → 2.0.0-beta.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "ogImage",
8
- "version": "2.0.0-beta.24"
8
+ "version": "2.0.0-beta.25"
9
9
  }
package/dist/module.mjs CHANGED
@@ -259,7 +259,7 @@ const RuntimeCompatibility = {
259
259
  };
260
260
 
261
261
  function getNitroProviderCompatibility(nuxt) {
262
- if (nuxt.options.dev || nuxt.options._prepare) {
262
+ if (nuxt.options.dev || nuxt.options._prepare || nuxt.options._generate) {
263
263
  return defu({
264
264
  wasm: "fetch",
265
265
  browser: "universal"
@@ -322,13 +322,13 @@ const module = defineNuxtModule({
322
322
  config.runtimeBrowser = false;
323
323
  logger.warn("It looks like you're using a nitro target that does not support the browser provider, disabling `runtimeBrowser`.");
324
324
  }
325
- if (nitroCompatibility.browser === "lambda") {
325
+ if (config.runtimeBrowser && nitroCompatibility.browser === "lambda") {
326
326
  logger.info("It looks like you're deploying to an environment which requires `chrome-aws-lambda`, checking for dependency...");
327
327
  await ensureDependency(nuxt, "chrome-aws-lambda");
328
328
  }
329
329
  config.siteUrl = config.siteUrl || config.host;
330
330
  if (!nuxt.options.dev && nuxt.options._generate && !config.siteUrl)
331
- logger.warn("Nuxt is being prerendered but no siteUrl is set. This will result in broken images.");
331
+ logger.warn("Missing `ogImage.siteUrl` and site is being prerendered. This will result in broken og images.");
332
332
  if (config.runtimeCacheStorage && !nuxt.options.dev) {
333
333
  nuxt.options.nitro.storage = nuxt.options.nitro.storage || {};
334
334
  nuxt.options.nitro.storage["og-image"] = config.runtimeCacheStorage;
@@ -9,7 +9,8 @@ import emojis from "./plugins/emojis.mjs";
9
9
  import encoding from "./plugins/encoding.mjs";
10
10
  import loadPngCreator from "#nuxt-og-image/png";
11
11
  import loadSatori from "#nuxt-og-image/satori";
12
- import { useNitroApp, useRuntimeConfig } from "#internal/nitro";
12
+ import { useRuntimeConfig } from "#imports";
13
+ import { useNitroApp } from "#internal/nitro";
13
14
  const satoriFonts = [];
14
15
  let fontLoadPromise = null;
15
16
  function loadFonts(fonts) {
@@ -12,8 +12,12 @@ export default defineEventHandler(async (e) => {
12
12
  const scale = query.scale;
13
13
  const mode = query.mode || "light";
14
14
  let options;
15
- if (query.options)
16
- options = JSON.parse(query.options);
15
+ if (query.options) {
16
+ try {
17
+ options = JSON.parse(query.options);
18
+ } catch {
19
+ }
20
+ }
17
21
  if (!options)
18
22
  options = await fetchOptions(e, path);
19
23
  if (options.provider === "browser" && !options.component) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.24",
4
+ "version": "2.0.0-beta.25",
5
5
  "packageManager": "pnpm@8.1.0",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",