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

Providers not being built into nuxt output #1264

Closed
jfelicianiats opened this issue Feb 26, 2024 · 1 comment
Closed

Providers not being built into nuxt output #1264

jfelicianiats opened this issue Feb 26, 2024 · 1 comment

Comments

@jfelicianiats
Copy link

jfelicianiats commented Feb 26, 2024

Issue

When running a production build of the application where the node_modules have been pruned via npm prune --production, if you don't include ipx in the "dependencies" section of your package.json, the application will fail to load images and if you check the network tab, the following error is listed for the image resources. Even installing ipx as a devDepdendency fails in the final build if node_modules are not present. Im assuming the ipx lib is not being built into the final nuxt output.

[500] [IPX_ERROR] Could not load the "sharp" module using the linuxmusl-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
    yarn add sharp --ignore-engines
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=linux --libc=musl --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install

Current Workaround

Installing the ipx library as a dependency and NOT a devDependency seems to remedy the issue.

Not working package.json

{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@nuxt/image": "^1.3.0",
    "@nuxtjs/eslint-config-typescript": "^12.1.0",
    "@nuxtjs/eslint-module": "^4.1.0",
    "@nuxtjs/i18n": "^8.0.0",
    "@nuxtjs/tailwindcss": "^6.11.0",
    "@types/lodash-es": "^4.17.12",
    "@typescript-eslint/parser": "^6.19.1",
    "@vee-validate/yup": "^4.12.5",
    "@vueuse/core": "^10.8.0",
    "eslint": "^8.56.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "nuxt": "^3.9.3",
    "prettier": "^3.2.4",
    "rimraf": "^5.0.5",
    "sass": "^1.70.0",
    "typescript": "^5.3.3",
    "vee-validate": "^4.12.5",
    "vue": "^3.4.14",
    "vue-router": "^4.2.5",
    "vue-tsc": "^1.8.27",
    "yup": "^1.3.3"
  },
}

Working

{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@nuxt/image": "^1.3.0",
    "@nuxtjs/eslint-config-typescript": "^12.1.0",
    "@nuxtjs/eslint-module": "^4.1.0",
    "@nuxtjs/i18n": "^8.0.0",
    "@nuxtjs/tailwindcss": "^6.11.0",
    "@types/lodash-es": "^4.17.12",
    "@typescript-eslint/parser": "^6.19.1",
    "@vee-validate/yup": "^4.12.5",
    "@vueuse/core": "^10.8.0",
    "eslint": "^8.56.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "nuxt": "^3.9.3",
    "prettier": "^3.2.4",
    "rimraf": "^5.0.5",
    "sass": "^1.70.0",
    "typescript": "^5.3.3",
    "vee-validate": "^4.12.5",
    "vue": "^3.4.14",
    "vue-router": "^4.2.5",
    "vue-tsc": "^1.8.27",
    "yup": "^1.3.3"
  },
  "dependencies": {
    "ipx": "^3.0.1"
  }
}
@danielroe
Copy link
Member

resolved in #1265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants