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

ERROR Cannot find package 'ipx' #1209

Closed
rain-sc opened this issue Jan 18, 2024 · 28 comments
Closed

ERROR Cannot find package 'ipx' #1209

rain-sc opened this issue Jan 18, 2024 · 28 comments

Comments

@rain-sc
Copy link

rain-sc commented Jan 18, 2024

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

Copy link
Contributor

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:

@Drew-Macgibbon
Copy link

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.

@rain-sc
Copy link
Author

rain-sc commented Jan 19, 2024

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

@AloisSeckar
Copy link

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

@zrooda
Copy link

zrooda commented Jan 21, 2024

Same issue, 1.2.0 works.

@Drew-Macgibbon
Copy link

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.

@gnidustotalus
Copy link

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?

@Ingramz
Copy link

Ingramz commented Jan 31, 2024

@SuperNickkk
Copy link

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

@pauloconnell
Copy link

pauloconnell commented Feb 15, 2024

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",

@Kheuval
Copy link

Kheuval commented Feb 20, 2024

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

@AloisSeckar
Copy link

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.

@davidsandoz
Copy link

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) 

@tysaner
Copy link

tysaner commented Apr 2, 2024

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

@davidsandoz
Copy link

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.

@furkansahintr
Copy link

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

@davidsandoz
Copy link

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
Copy link

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

@szadave
Copy link

szadave commented May 29, 2024

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.

@davidsandoz
Copy link

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.

@yxw007
Copy link

yxw007 commented Jul 5, 2024

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

@yxw007
Copy link

yxw007 commented Jul 5, 2024

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.

@tedonggo
Copy link

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

@libracoder
Copy link

I am getting this issue with

ipx 3.0.1
node 20.17
nuxt/image 1.8.0
npm 10.8.2

@danielislas3
Copy link

Experiencing the same issue. Any help would be appreciated!

@irorange27
Copy link

Also met the issue with, but I have solved

@nuxt/image: 1.8.1
@nuxtjs/color-mode: 6.5.1
nuxt: 3.13.0
ipx: 3.0.1

node: v20.18.0
npm: v10.9.0

Solve it with rm -r node_modules and reinstall it.

@Baroshem
Copy link
Collaborator

Baroshem commented Dec 9, 2024

Closing as the solution was provided.

@Baroshem Baroshem closed this as completed Dec 9, 2024
@SuperNickkk
Copy link

Thank you all for your input.

I have to say that I long since stopped using Nuxt Image as I started using bash to convert to an appropriate file size and format.

I can't comment on whether newer versions of Nuxt Image solved this problem. But with 1.3.0 removing nuxt_modules was never the solution.

Someone who is still using Nuxt Image might want to double check this. . .

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

No branches or pull requests