Closed imdangle closed 8 months ago
Same issue here! Downgrading to 2.1.1 seems to fix it for now.
Confirmed! It's worked 😁. Thanks so much. But I think this issue should not closed.
Same issue here! Downgrading to 2.1.1 seems to fix it for now.
Confirming that this worked for me as well.
@kmelve @stipsan have you had a chance to look at it? 👀
Same issue here! Downgrading to 2.1.1 seems to fix it for now.
Confirming that this worked for me as well, thanks!
Looks like sanityIntegration is not the default export anymore (seems to be a bug).
A workaround for the latest version (2.1.4
) seems to be solving the issue
import sanity from "@sanity/astro"
import { sanityIntegration as sanity } from "@sanity/astro"
Any news about this?
still having the issue with:
"@sanity/astro": "^2.1.4",
"@sanity/client": "^6.8.0",
"astro": "^3.5.2",
"sanity": "3.19.2",
Even after degrading it. Still having same issue
[vite] Error when evaluating SSR module /home/elamandeep/Desktop/Projects/newportfolio/src/pages/works.astro: failed to import "sanity:client"
|- Error: Cannot find module 'sanity:client' imported from '/home/elamandeep/Desktop/Projects/newportfolio/src/pages/works.astro'
at nodeImport (file:///home/elamandeep/Desktop/Projects/newportfolio/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56088:25)
at ssrImport (file:///home/elamandeep/Desktop/Projects/newportfolio/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55990:30)
at eval (/home/elamandeep/Desktop/Projects/newportfolio/src/pages/works.astro:5:37)
at async instantiateModule (file:///home/elamandeep/Desktop/Projects/newportfolio/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:9)
error Cannot find module 'sanity:client' imported from '/home/elamandeep/Desktop/Projects/newportfolio/src/pages/works.astro'
Error: Cannot find module 'sanity:client' imported from '/home/elamandeep/Desktop/Projects/newportfolio/src/pages/works.astro'
at nodeImport (file:///home/elamandeep/Desktop/Projects/newportfolio/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56088:25)
at ssrImport (file:///home/elamandeep/Desktop/Projects/newportfolio/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:55990:30)
at eval (/home/elamandeep/Desktop/Projects/newportfolio/src/pages/works.astro:5:37)
at async instantiateModule (file:///home/elamandeep/Desktop/Projects/newportfolio/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:56052:9)
@salv0 try to add this in your asto.config.mjs
import { sanityIntegration } from #"@sanity/astro";
remove
sanity()
from intergration and add this
sanityIntegration({
projectId: "<project id>",
dataset: "<name of database>",
// Set useCdn to false if you're building statically.
useCdn: false,
}),
Should be solved in #149 – thanks for reporting! (Astro requires a default export for npx astro add
installation)
If you find a security vulnerability, do NOT open an issue. Email security@sanity.io instead.
Describe the bug
Error: [vite] Error when evaluating SSR module, __vite_ssr_import_2__.default is not a function. I followed the guide for integrating Astro and Sanity but when I ran 'yarn dev' and this error happened. If I comment sanity integration code block in astro.config.mjs, the error is gone.
To Reproduce
Steps to reproduce the behavior:
Follow these steps from The official Sanity integration for Astro
REPO
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Which versions of Sanity are you using?
Run
sanity versions
in the terminal and copy-paste the result here.sanity 3.18.1
What operating system are you using? MacOS
Which versions of Node.js / npm are you running?
Run
npm -v && node -v
in the terminal and copy-paste the result here. 10.2.0 v18.18.0Additional context
Add any other context about the problem here.
Security issue?
Any security issues should be submitted directly to [security@sanity.io](mailto:security@ sanity.io). In order to determine whether you are dealing with a security issue, ask yourself these two questions: