astro-imagetools
astro-imagetools copied to clipboard
Unable to build astro app when using Picture component
I am getting the following error when I try to run npm run build
command:
It works when I comment component import:
import { Picture } from "astro-imagetools/components";
Also, I am getting warning:
Could not find a declaration file for module 'astro-imagetools/components'. './node_modules/astro-imagetools/components/index.js' implicitly has an 'any' type. If the 'astro-imagetools' package actually exposes this module, try adding a new declaration (.d.ts) file containing
declare module 'astro-imagetools/components';`
I am using astro-imagetool version 0.6.10
Am I doing something wrong?
same here. Fresh astro basics template at least in rc7 and 1.0.1, following installation steps in docs. The first time I use import picture i get the findUp not found error.
This was working in astro beta.70, and seems to have broken somewhere between that and 1.0.1. I'm not sure why, but astro is trying to use an older version of find-up, even though this project depends on the latest ESM-only version of find-up. I started to get lots of other similar errors for other packages when updating as well, so something seems to have changed in astro for sure.
I was able to get things working by removing my node_modules
and package-lock.json
and re-installing. It seems like maybe semver wasn't followed entirely properly by either astro or a sub-dependency. Or npm is doing something else strange with the way it hoists packages.
If that doesn't work for you, you could try adding find-up
to vite.ssr.noExternal
.
I was able to get things working by removing my
node_modules
andpackage-lock.json
and re-installing.
I can confirm this workaround by @IanVS solved the build problem at least in my case. Thank you very much!!
I'm getting the same issue, and deleting node_modules
and package-log.json
is not fixing it. Adding find-up
to vite.ssr.noExternal
also does not work.
Just had this issue, using astro 1.3.0
and astro-imagetools 0.6.11
.
I fixed it by adding "find-up": "^6.3.0"
in package.json as dev dependency, and then running npm install
.
Has anyone notified the Astro team on this by the way?
@Joffreybvn solution works for me
Has anyone notified the Astro team on this by the way?
The astro team is building out their own official image integration, and I don't think they have any control over this package. And it seems to be unmaintained now unfortunately.
Just had this issue, using astro
1.3.0
and astro-imagetools0.6.11
. I fixed it by adding"find-up": "^6.3.0"
in package.json as dev dependency, and then runningnpm install
.
This has worked for me, I currently using [email protected], but something strange is that if I install the dependencies with PNPM when I run pnpm build
it fails, on the contrary if I use npm install
, everything works fine on build.