image icon indicating copy to clipboard operation
image copied to clipboard

ERROR Cannot find package 'ipx'

Open rain-sc opened this issue 1 year ago • 26 comments

Node: 18.8.0 Nuxt: ^3.9.0 Nuxt-Img: ^1.1.0

WARN "ipx" is imported by "node_modules/@nuxt/image/dist/runtime/ipx.mjs", but could not be resolved – treating it as an external dependency.

ERROR Cannot find package 'ipx' imported from /vue/.nuxt/prerender/index.mjs

rain-sc avatar Jan 18 '24 03:01 rain-sc

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a template for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/image/tree/main/example

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

github-actions[bot] avatar Jan 18 '24 09:01 github-actions[bot]

Hi, I also ran into this error.

Reproduced with a clean nuxi init and npm i -D @nuxt/image

https://github.com/Drew-Macgibbon/cannot-find-ipx-reproduction

I downgraded to @nuxt/[email protected] and everything worked fine.

Drew-Macgibbon avatar Jan 18 '24 15:01 Drew-Macgibbon

Hi, I also ran into this error.

Reproduced with a clean nuxi init and npm i -D @nuxt/image

https://github.com/Drew-Macgibbon/cannot-find-ipx-reproduction

I downgraded to @nuxt/[email protected] and everything worked fine.

I ran your project and downgraded it will worked. but it can not solve @nuxt/image latest version ^1.3.0 If I use

rain-sc avatar Jan 19 '24 02:01 rain-sc

I can confirm this happens to me too.

------------------------------
- Operating System: Windows_NT
- Node Version:     v18.14.0
- Nuxt Version:     3.9.3
- CLI Version:      3.10.0
- Nitro Version:    2.8.1
- Package Manager:  [email protected]
- Builder:          -
- User Config:      ssr, devtools, modules, runtimeConfig, image, supabase
- Runtime Modules:  @vueuse/[email protected], @nuxt/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @nuxtjs/[email protected], @formkit/[email protected], @pinia/[email protected]
- Build Modules:    -
------------------------------
  "devDependencies": {
    "@formkit/nuxt": "1.5.1",
    "@nuxt/image": "1.3.0",
    "@nuxtjs/eslint-config-typescript": "12.1.0",
    "@nuxtjs/i18n": "8.0.0",
    "@nuxtjs/supabase": "1.1.5",
    "@nuxtjs/tailwindcss": "6.10.4",
    "@pinia/nuxt": "0.5.1",
    "@vueuse/core": "10.7.2",
    "@vueuse/nuxt": "10.7.2",
    "elrh-pslo": "1.0.1",
    "eslint": "8.56.0",
    "infinitimeline": "0.4.2",
    "nuxt": "3.9.3",
    "openapi-typescript": "5.4.1",
    "pinia": "2.1.7",
    "supabase": "1.131.5",
    "tailwindcss": "3.4.1"
  }

Version 1.3.0 is broken, 1.2.0 works

AloisSeckar avatar Jan 20 '24 11:01 AloisSeckar

Same issue, 1.2.0 works.

zrooda avatar Jan 21 '24 13:01 zrooda

I ran your project and downgraded it will worked. but it can not solve @nuxt/image latest version ^1.3.0 If I use

I also faced this error in 3 other projects, 1.3.0 must have introduced some error. Just reverting to 1.2.0 until fixed.

I would be interested to know if using nuxi add nuxt/image still causes the issue. I use npm i when adding packages.

Drew-Macgibbon avatar Jan 24 '24 04:01 Drew-Macgibbon

In my case, the solution turned out to be installing a newer version of Node using NVM, specifically upgrading from version 18.16.0 to 18.19.0. Is it possible that the issue was related to the npm cache?

gnidustotalus avatar Jan 24 '24 21:01 gnidustotalus

Sharp seems to require node 18.17.0 or newer. https://github.com/lovell/sharp/blob/bd4f1abba28831b8db246366f2f5f8d5ed701eac/package.json#L188-L191

Ingramz avatar Jan 31 '24 12:01 Ingramz

I appear to have the same issue. 1.3.0 doesn't work, but 1.2.0 does.

My node version is 20.11.0

SuperNickkk avatar Feb 03 '24 10:02 SuperNickkk

I have the same issue -but running 1.2.0 doesn't fix it... Must be because I'm running older versions: running node 18.12.1, running "nuxt": "3.2.3",

pauloconnell avatar Feb 15 '24 00:02 pauloconnell

Hi, I have the same issue. Node version : 20.10.0 Nuxt version : 3.10.2

1.2.0 works fine but not 1.3.0

Kheuval avatar Feb 20 '24 06:02 Kheuval

I encountered this problem again today in my Netlify deplyoment pipeline and it got fixed just by pinning Node version to recent 18.19.1 via environment variable. Didn't have to regress Nuxt Image.

AloisSeckar avatar Feb 21 '24 21:02 AloisSeckar

I'm getting the same issue with 1.4.0, while I didn't have it with 1.3.0.

Node version : 20.11.1 Nuxt version: 3.10.3

logs
...
[info] ✓ built in 3.27s
[success] Server built in 3280ms
[info] [nitro] Initializing prerenderer
[error] Cannot find package 'ipx' imported from /builds/my-website/.nuxt/prerender/index.mjs
  at packageResolve (node:internal/modules/esm/resolve:853:9)
  at moduleResolve (node:internal/modules/esm/resolve:910:20)
  at defaultResolve (node:internal/modules/esm/resolve:1130:11)
  at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
  at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
  at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
  at link (node:internal/modules/esm/module_job:84:36) 

davidsandoz avatar Mar 06 '24 07:03 davidsandoz

I'm getting the same issue with 1.4.0, while I didn't have it with 1.2.0.

Node version : 20.11.1 Nuxt version: 3.11.1

So I downgraded the version of @nuxt/iamge to 1.2

tysaner avatar Apr 02 '24 03:04 tysaner

I'm still getting the error with 1.5.0.

I also noticed that it happens only with nuxt generate, not with nuxt build.

Downgrading to 1.3.0 makes it work again.

davidsandoz avatar Apr 18 '24 13:04 davidsandoz

I'm still getting the error with 1.5.0.

I also noticed that it happens only with nuxt generate, not with nuxt build.

Downgrading to 1.3.0 makes it work again.

look at this; https://image.nuxt.com/advanced/static-images

furkansahintr avatar Apr 28 '24 19:04 furkansahintr

Thanks, @furkansahintr. However, I don't have ssr: false in nuxt.config. As I'm doing nuxt generate, the website is server-side generated (SSG), and as specified in the documentation page you linked:

If you are building a static site using nuxt generate, Nuxt Image will optimize and save your images locally when your site is generated - and deploy them alongside your generated pages.

Hence, the images should be generated automatically, without the need to specify them in the nitro.preprender.routes option. I understand that this would be if one is using Nuxt in SPA mode (not SSR nor SSG).

davidsandoz avatar Apr 29 '24 06:04 davidsandoz

ℹ️ I'm still getting the error with v1.7.0

davidsandoz avatar May 21 '24 06:05 davidsandoz

Node Version: 20.13.1
Nuxt Version: 3.11.2
Nuxt Image Version: 1.7.0 OS: Windows: 11 23H2

Issue: After cloning and running npm install on a new machine, I encountered this error.

Additional Information: If I run npm i ipx, it works, but this is not a clean solution.

szadave avatar May 29 '24 00:05 szadave

I was able to dismiss the error by running npm update. It didn't update ipx (it was, and still is at v2.1.0). But it updated the lockfile version of package-lock.json from v2 to v3. Maybe that was the issue.

davidsandoz avatar Jun 03 '24 06:06 davidsandoz

At present, it seems that only 1.3.0 is a reliable and available version.

yxw007 avatar Jul 05 '24 10:07 yxw007

NuxtImage, I did 2 tests

  • Test 1: Create a new nuxt project with integrated @nuxt/image and work (prove: @nuxt/image latest version 1.7.0 is fine)
  • Test 2: The existing project integrates @nuxt/image, which cannot be used normally, so I deleted all the node_modules, and found that it works normally after re-clicking pnpm install

Summary: There should be a problem with the installation cache,clear the cache and reinstall it.

yxw007 avatar Jul 05 '24 14:07 yxw007

NuxtImage, I did 2 tests

  • Test 1: Create a new nuxt project with integrated @nuxt/image and work (prove: @nuxt/image latest version 1.7.0 is fine)
  • Test 2: The existing project integrates @nuxt/image, which cannot be used normally, so I deleted all the node_modules, and found that it works normally after re-clicking pnpm install

Summary: There should be a problem with the installation cache,clear the cache and reinstall it.

Thanks, test2 is useful

tedonggo avatar Jul 21 '24 09:07 tedonggo