Skip to content

Can't build or open Sanity Studio #78

@13AvtarSingh

Description

@13AvtarSingh

Hi,

I've made a new project with SanityPress but I can't seem to get it built and deployed properly. I wanted to set up the deployments via Sanity Studio.

I've tried this:
npx sanity build

Which leads to:

✓ Clean output folder (7ms)
✗ Build Sanity Studio

`[vite]: Rollup failed to resolve import "@/sanity/lib/env" from ".../sanity.config.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

npx sanity start causes this when I go to localhost:3333:
[plugin:vite:import-analysis] Failed to resolve import "@/sanity/lib/env" from "sanity.config.ts". Does the file exist?

And in the console running the dashboard tool, I'm getting more errors in a similar vein:
[vite] (client) Pre-transform error: Failed to resolve import "@/lib/env" from "src/sanity/presentation.ts". Does the file exist?

I've also checked tsconfig.json, which has this from the default setup:
"paths": { "@/*": [ "./src/*" ], "$/*": [ "./*" ], "react": [ "./node_modules/@types/react" ] }

I'd appreciate any help on this. Other than the .env files, I haven't changed anything to do with the build process so I'm confused why it won't work out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions