-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Custom components don't work #9879
Comments
I have been seeing the same issue. Looking into it atm. |
I'v fixed this issuse. You should create a Details: {
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"verbatimModuleSyntax": true,
"strict": true,
"moduleResolution": "node",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"types": ["svelte"],
"baseUrl": "."
},
"include": ["src/**/*", "*.svelte"],
"exclude": ["node_modules"]
} The key setting is "verbatimModuleSyntax": true,
|
Ooooh |
@zhangzhengde0225 's workaround fixed the |
It seems the error occurs when |
@moreauadrien The following at least solves the cd frontend
npm i -D @tsconfig/svelte svelte-preprocess typescript
tee tsconfig.json <<EOF
{
"extends": "@tsconfig/svelte/tsconfig.json"
}
EOF However, the dependency of |
Adding a vite plugin could resolve the CommonJS compatibility issue. cd frontend
npm i -D vite-plugin-commonjs
import commonjs from "vite-plugin-commonjs";
export default {
plugins: [
commonjs({
filter(id) { return id.includes("node_modules/deepmerge"); }
})
],
svelte: {
preprocess: [],
},
build: {
target: "modules",
},
}; |
Describe the bug
I tried to create a custom component and the templates don't seem to work.
Have you searched existing issues? 🔎
Reproduction
Screenshot
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: