-
Notifications
You must be signed in to change notification settings - Fork 287
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
Skipping sharp dependency? #379
Comments
Thanks for suggesting this. Does making |
Yeah, ipx/sharp as optional dependency for local/development and opting out on production would be great. If you point me in the direction on how this can be implemented, I can try to provide a PR. I'm not sure how to make dependencies work with conditions. |
Thanks. I'll open a PR soon. |
Unfortunately this didn't fix the issue. As we're throwing an Error, the build fails when packages are installed with
|
@PatrickHeneise Would you please share nuxt.config? This is odd that ipx provider is enabled since for vercel deployments, it has to auto switch to vercel. |
We're not using Vercel.
The error throws straight after |
Thanks! I could reproduce and tracked down issue to resolveProvides that is always enabling |
Does this effectively make the whole module non-working? Or is there a fix that will prevent the nuxt-image from trying to load ipx (which is not needed)
|
I also get that without stroyblock and other shit, on localhost
When I make en error in ohmyfetch from node_modules
but what image have ohmyfetch with fetch? image module use fetch to load make direct calls? |
Hi there. I'm getting this error too. My env:
I've installed @nuxt/image by running When I run yarn run v1.22.15
$ nuxt generate
ℹ Merging Tailwind config from ~/tailwind.config.js
ERROR [@nuxt/image] ipx is an optional dependency for local image optimization and is not properly installed. Please try npm install or yarn install again.
FATAL TypeError: Invalid host defined options
at node_modules/@nuxt/image/dist/module.cjs:112:13
at async Object.ipxSetup [as setup] (node_modules/@nuxt/image/dist/module.cjs:110:48)
at async ModuleContainer.imageModule2 (node_modules/@nuxt/image/dist/module.cjs:262:7)
at async ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:239:20)
╭────────────────────────────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ Error: TypeError: Invalid host defined options │
│ │
╰────────────────────────────────────────────────────╯
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
My
const fetch = require("node-fetch");
export default {
head: {
title: "Bored Teachers | Celebrating Educators Every Day.",
htmlAttrs: {
lang: "en"
},
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{
hid: "description",
name: "description",
content: "Celebrating Educators Every Day."
},
// Twitter
// Test on: https://cards-dev.twitter.com/validator
{
hid: "twitter:card",
name: "twitter:card",
content: "summary_large_image"
},
{ hid: "twitter:site", name: "twitter:site", content: "@Bored_Teachers" },
{
hid: "twitter:url",
name: "twitter:url",
content: "https://boredteachers.com"
},
{
hid: "twitter:title",
name: "twitter:title",
content: "Bored Teachers | Celebrating Educators Every Day."
},
{
hid: "twitter:description",
name: "twitter:description",
content: "Celebrating Educators Every Day."
},
{
hid: "twitter:image",
name: "twitter:image",
content:
"https://new.boredteachers.com/wp-content/uploads/2021/06/BT-HI-RES-LOGO.png"
},
// Open Graph
// Test on: https://developers.facebook.com/tools/debug/
{
hid: "og:site_name",
property: "og:site_name",
content: "Bored Teachers"
},
{ hid: "og:type", property: "og:type", content: "website" },
{
hid: "og:url",
property: "og:url",
content: "https://boredteachers.com"
},
{
hid: "og:title",
property: "og:title",
content: "Bored Teachers | Celebrating Educators Every Day."
},
{
hid: "og:description",
property: "og:description",
content: "Celebrating Educators Every Day."
},
{
hid: "og:image",
property: "og:image",
content:
"https://new.boredteachers.com/wp-content/uploads/2021/06/BT-HI-RES-LOGO.png"
},
{
hid: "og:image:secure_url",
property: "og:image:secure_url",
content:
"https://new.boredteachers.com/wp-content/uploads/2021/06/BT-HI-RES-LOGO.png"
},
{
hid: "og:image:alt",
property: "og:image:alt",
content: "BoredTeachers"
},
{
hid: "fb:app_id",
property: "fb:app_id",
content: "355427452233649"
}
],
link: [
{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
{
rel: "stylesheet",
href:
"https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap"
},
{
rel: "stylesheet",
href:
"https://fonts.googleapis.com/css2?family=Sora:wght@100;200;300;400;500;600;700;800&display=swap"
},
{
rel: "stylesheet",
href:
"https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap"
},
{
rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=Fugaz+One&display=swap"
}
],
script: [
// { src: '/privy.js' },
// { src: 'https://widget.privy.com/assets/widget.js', async: true },
]
},
loading: {
color: "#25D6B2",
height: "5px"
},
target: "static",
router: {
middleware: ["redirects"]
},
env: {
YT_API: "", // hidden
BASE_URL: "https://boredteachers.com"
},
privateRuntimeConfig: {
ytApi: process.env.YT_API
},
publicRuntimeConfig: {
baseUrl: process.env.BASE_URL || "https://boredteachers.com"
},
generate: {
fallback: "404.html",
// crawler: false,
interval: 300,
// exclude: [
// '/memes'
// ],
routes: function() {
const uri = "https://new.boredteachers.com/index.php?graphql=query";
const query = `{
categories(first: 9999) {
edges {
node {
slug
}
}
}
giveaways(first: 9999) {
edges {
node {
slug
}
}
}
listicles(first: 9999) {
edges {
node {
slug
}
}
}
memes(first: 9999) {
edges {
node {
slug
}
}
}
posts(first: 9999) {
edges {
node {
slug
}
}
}
printables(first: 9999) {
edges {
node {
slug
}
}
}
shoppingLists(first: 9999) {
edges {
node {
slug
}
}
}
videos(first: 9999) {
edges {
node {
slug
}
}
}
}`;
return fetch(uri, {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ query })
})
.then(result => result.json())
.then(result => {
const { data } = result;
let routes = [];
let tempArr = [];
/* categories */
tempArr = data.categories.edges.map(category => {
return {
route: `/category/${category.node.slug}`
};
});
routes = tempArr.concat(routes);
/* giveaways */
tempArr = data.giveaways.edges.map(giveaway => {
return {
route: `/giveaway/${giveaway.node.slug}`
};
});
routes = tempArr.concat(routes);
/* listicles */
tempArr = data.listicles.edges.map(listicle => {
return {
route: `/post/${listicle.node.slug}`
};
});
routes = tempArr.concat(routes);
/* memes */
tempArr = data.memes.edges.map(meme => {
return {
route: `/meme/${meme.node.slug}`
};
});
routes = tempArr.concat(routes);
/* posts */
tempArr = data.posts.edges.map(post => {
return {
route: `/post/${post.node.slug}`
};
});
routes = tempArr.concat(routes);
/* printables */
tempArr = data.printables.edges.map(printable => {
return {
route: `/printable/${printable.node.slug}`
};
});
routes = tempArr.concat(routes);
/* shoppingLists */
tempArr = data.shoppingLists.edges.map(shoppingList => {
return {
route: `/post/${shoppingList.node.slug}`
};
});
routes = tempArr.concat(routes);
/* videos */
tempArr = data.videos.edges.map(video => {
return {
route: `/video/${video.node.slug}`
};
});
routes = tempArr.concat(routes);
return routes;
})
.catch(error => {
console.error(error);
});
}
},
css: ["~/assets/main.css"],
plugins: [
"~/plugins/scripts.client",
"~/plugins/vue-js-modal.js",
"~/plugins/tooltips.js",
{
src: "@/plugins/slider",
mode: "client",
ssr: false
},
{
src: "~/plugins/global-gutenberg-components-loader.js"
},
"~/plugins/axios.js",
"~/plugins/podcasts.js",
"~/plugins/freestarAds.js",
"~/plugins/preview.client.js"
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
buildModules: [
"@nuxtjs/tailwindcss",
"@nuxtjs/google-analytics",
"@nuxt/image"
],
modules: [
"@nuxtjs/axios",
"@nuxtjs/apollo",
"nuxt-helmet",
"vue-social-sharing/nuxt",
"@nuxtjs/proxy",
"nuxt-facebook-pixel-module"
],
facebook: {
track: "PageView",
pixelId: "712475899386953",
autoPageView: true,
disabled: false
},
apollo: {
includeNodeModules: true,
clientConfigs: {
default: "@/apollo/client-configs/default.js"
},
errorHandler: "~/plugins/apollo-error-handler.js"
},
helmet: {},
googleAnalytics: {
id: "UA-76795799-1"
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
extend(config, { isClient, isServer }) {
config.node = {
fs: "empty",
child_process: "empty",
tls: "empty",
net: "empty"
};
config.resolve.alias["vue$"] = "vue/dist/vue.esm.js";
if (isServer) {
config.externals = [
{
canvas: "util"
}
];
}
}
},
image: {
domains: ["new.boredteachers.com"]
}
}; |
Hi, I'm having the same issue! Works on my local computer and in GithubAction but fails during Heroku deployment. |
I have the same issue on Namecheap hosting, any fix? |
hey I'm getting a issue when running my project with yarn start : When i build it for production with:
using this version in devDependencies: "@nuxt/image-edge": "^1.0.0-28059208.2abef1b" ipx doubles my build size and i don't need it, it would be nice to have a flag to disable it. |
i assume there is no solution so far? that's pity |
@olegdon ipx (because of sharp) is now an optional dependency and also you can set provider to |
Hi there. When using external image optimization providers in a production environment,
sharp
is obsolete, correct? Is there a possibility to skip the installation? The binaries are causing a bit of a headache between various environments.The text was updated successfully, but these errors were encountered: