Issue Duplicating This Space

#36
by mpayton365 - opened

How to duplicate the space successfully?

The build failed because DOTENV_LOCAL is missing with this error
--> ERROR: secret DOTENV_LOCAL: not found.

So added a field called DOTENV_LOCAL with some random words as secret under Repository Secrets section in the Settings. But still got another error:

--> RUN --mount=type=secret,id=DOTENV_LOCAL,mode=0444,required=true cat /run/secrets/DOTENV_LOCAL > .env.local
DONE 0.2s

--> RUN npm run build

[email protected] build
vite build

vite v4.2.1 building SSR bundle for production...
transforming...
9:54:19 PM [vite-plugin-svelte] /src/lib/components/chat/ChatInput.svelte:36:2 A11y: Avoid using autofocus
34: on:keydown={handleKeydown}
35: {placeholder}
36: {autofocus}
^
37: />
38:
โœ“ 109 modules transformed.
9:54:20 PM [vite-plugin-svelte] ssr compile done.
package files time avg
chat-ui 32 0.20s 6.3ms
rendering chunks...
/app/node_modules/mongodb-connection-string-url/lib/index.js:86
throw new MongoParseError('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');
^

MongoParseError: Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"
at new ConnectionString (/app/node_modules/mongodb-connection-string-url/lib/index.js:86:19)
at parseOptions (/app/node_modules/mongodb/lib/connection_string.js:191:17)
at new MongoClient (/app/node_modules/mongodb/lib/mongo_client.js:46:63)
at file:///app/.svelte-kit/output/server/chunks/database.js:3:16
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)

Node.js v19.9.0
[vite-plugin-sveltekit-compile] Failed with code 1
โœ“ built in 2.56s
error during build:
Error: Failed with code 1
at ChildProcess. (file:///app/node_modules/@sveltejs/kit/src/utils/fork.js:68:13)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)

--> ERROR: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1

Please help.

Hugging Chat org
โ€ข
edited Apr 25, 2023

You need to create a DOTENV_LOCAL secret, which contains the contents of the .env file but filled with sensitive data, including a MongoDB url, the endpoint to call the model and your HF token.

Look at the contents of https://huggingface.co/spaces/huggingchat/chat-ui/blob/main/.env

Regarding the endpoint to call the model, it can be https://api-inference.huggingface.co/models/{the model name}

mpayton365 changed discussion status to closed

Sign up or log in to comment