o_O
o_O
Explore posts from servers
TTCTheo's Typesafe Cult
Created by o_O on 10/25/2023 in #questions
uploadthing's github example for express adapter is not working. Possible bug.
I cloned the repo and followed the following steps but it didn't work.
git clone https://github.com/pingdotgg/uploadthing/
cd uploadthing/examples/backend-adapters/server
pnpm install
cp .env.example .env
// pasted env variables to .env //
pnpm dev:express
git clone https://github.com/pingdotgg/uploadthing/
cd uploadthing/examples/backend-adapters/server
pnpm install
cp .env.example .env
// pasted env variables to .env //
pnpm dev:express
Error: Error: Cannot find module '/home/.../uploadthing/examples/backend-adapters/server/node_modules/uploadthing/dist/express.js'
Error: Error: Cannot find module '/home/.../uploadthing/examples/backend-adapters/server/node_modules/uploadthing/dist/express.js'
pnpm install express
pnpm install express
Error: Cannot find module '/home/.../uploadthing/examples/backend-adapters/server/node_modules/uploadthing/dist/express.js'
Error: Cannot find module '/home/.../uploadthing/examples/backend-adapters/server/node_modules/uploadthing/dist/express.js'
Running node v18.17.1
1 replies
TTCTheo's Typesafe Cult
Created by o_O on 10/24/2023 in #questions
Error message change with changing from npm to yarn. Uploadthing doesn't work in either case.
My node.js
import { createUploadthing } from 'uploadthing/express'
const f = createUploadthing()
import { createUploadthing } from 'uploadthing/express'
const f = createUploadthing()
Error when using npm:
file:///home/person/node-project/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:12
throw new Error('Dynamic require of "' + x + '" is not supported');
Error: Dynamic require of "path" is not supported
file:///home/person/node-project/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:12
throw new Error('Dynamic require of "' + x + '" is not supported');
Error: Dynamic require of "path" is not supported
Error when using yarn
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'zod' imported from /home/person//node-project/uploadthing-example/node_modules/@uploadthing/shared/dist/
index.mjs
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'zod' imported from /home/person//node-project/uploadthing-example/node_modules/@uploadthing/shared/dist/
index.mjs
So I manually installed zod with yarn add zod and got the same message as npm
file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:12
throw new Error('Dynamic require of "' + x + '" is not supported');
^

Error: Dynamic require of "path" is not supported
at file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:12:9
at ../../node_modules/.pnpm/[email protected]/node_modules/depd/index.js (file: ///home/person/uploadthing-example/node_modules/uploadthing/dis
t/express.mjs: 20: 20)
at __require2 (file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:15:50)
at ../../node_modules/.pnpm/[email protected]/node_modules/body-parser/index.js (file: ///home/person/uploadthing-example/node_modules/
uploadthing/dist/express.mjs: 16511: 21)
at __require2 (file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:15:50)
at ../../node_modules/.pnpm/[email protected]/node_modules/express/lib/express.js (file: ///home/person/uploadthing-...
Node.js v18.17.1
file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:12
throw new Error('Dynamic require of "' + x + '" is not supported');
^

Error: Dynamic require of "path" is not supported
at file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:12:9
at ../../node_modules/.pnpm/[email protected]/node_modules/depd/index.js (file: ///home/person/uploadthing-example/node_modules/uploadthing/dis
t/express.mjs: 20: 20)
at __require2 (file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:15:50)
at ../../node_modules/.pnpm/[email protected]/node_modules/body-parser/index.js (file: ///home/person/uploadthing-example/node_modules/
uploadthing/dist/express.mjs: 16511: 21)
at __require2 (file: ///home/person/uploadthing-example/node_modules/uploadthing/dist/chunk-T2XS27LC.mjs:15:50)
at ../../node_modules/.pnpm/[email protected]/node_modules/express/lib/express.js (file: ///home/person/uploadthing-...
Node.js v18.17.1
4 replies