-
Notifications
You must be signed in to change notification settings - Fork 451
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
Typegen error - Failed to load configuration - sanity.defineLocaleResourceBundle is not a function #8646
Comments
The similar error occurs for me as well. I've tried it with both LTS and Current Node.js versions, and even with pnpm and yarn. I've deleted node_modules multiple times. Unfortunately, while the error occurs locally, it works flawlessly when pushed to Vercel. ✗ Failed to extract schema, with enforced required fields
ReferenceError: Failed to load configuration file "C:/Users/Username/Documents/GitHu
b/reformmarine-v2/sanity.config.ts":
require is not defined
at file:///C:/Users/Username/Documents/GitHub/reformmarine-v2/node_modules/lucid
e-react/dist/cjs/lucide-react.js:10:13
at Object.newLoader [as .js] (C:/Users/Username/Documents/GitHub/reformmarine-v2
/node_modules/esbuild-register/dist/node.js:2262:9)
at extensions..js (C:/Users/Username/Documents/GitHub/reformmarine-v2/node_modul
es/esbuild-register/dist/node.js:4833:24)
error
Command failed with exit code 1. @sanity/cli (global) 3.76.1 (up to date)
@sanity/image-url 1.1.0 (up to date)
@sanity/vision 3.76.1 (up to date)
sanity 3.76.1 (up to date) Tested On
Node: v22.14.0 - v23.7.0
pnpm: 9.15.x - 10.4.0
yarn: v1.22.22
Need help ASAP. Thanks! |
I managed to solve this by removing |
At first, deleting node_modules worked for me too. But it doesn’t affect at all anymore. I get a TypeScript error because there is currently no type in my project. In order to solve the problem, the typegen needs to create schemes, so my project is frozen and waiting for a solution without working. Also, there was a typegen in my previous project and it worked smoothly, but when I updated to dependencies even though the project was over, the same error started there. |
Describe the bug
When running typegen script, I get the following TypeError
Weirdly, nothing has changed on my end and this happens even on older branches.
To Reproduce
Steps to reproduce the behavior:
package.json
"typegen": "sanity schema extract --enforce-required-fields && sanity typegen generate"
sanity-typegen.json
file correctly setuppnpm typegen
Expected behavior
Typegen should happen without error
Screenshots
If applicable, add screenshots to help explain your problem.
Which versions of Sanity are you using?
@sanity/cli (global) 3.73.0 (latest: 3.75.0)
@sanity/asset-utils 2.2.1 (up to date)
@sanity/cli 3.74.1 (latest: 3.75.0)
@sanity/color-input 4.0.3 (up to date)
@sanity/eslint-config-studio 5.0.1 (up to date)
@sanity/icons 3.5.7 (latest: 3.6.0)
@sanity/ui 2.11.8 (latest: 2.13.0)
@sanity/vision 3.74.1 (latest: 3.75.0)
sanity 3.74.1 (latest: 3.75.0)
What operating system are you using?
MacOS latest
Which versions of Node.js / npm are you running?
Node v22.13.1
pnpm 10.2.0
Additional context
If I remove the vision plugin from sanity config, the typegen happens without an issue.
The text was updated successfully, but these errors were encountered: