Comments (8)
I fixed the above issue with following update
import * as companion from '@uppy/companion'
...
let appResult = companion.app(companionOptions);
let companionApp = appResult.app;
app.use('/', companionApp)
companion.socket(app.listen(3020))
``
from uppy.
I just tested your code. it seems to have multiple problems, but once i fixed those and the code looks like this:
// index.js
import companion from "@uppy/companion";
const companionOptions = {
providerOptions: {
drive: {
key: 'GOOGLE_DRIVE_KEY',
secret: 'GOOGLE_DRIVE_SECRET',
},
},
secret: '123',
server: {
host: 'localhost:3020',
protocol: 'http',
// This MUST match the path you specify in `app.use()` below:
path: '/companion',
},
filePath: './folder',
};
const companionApp = companion.app(companionOptions);
... but then it works for me:
yarn init -2
yarn add @uppy/[email protected]
node .
companion: 2024-02-12T09:18:05.196Z [error] startup.uploadUrls Running without uploadUrls is a security risk and Companion will refuse to start up when running in production (NODE_ENV=production)
companion: 2024-02-12T09:18:05.204Z [info] jobs.cleanup.start starting clean up job
from uppy.
Thanks @mifi As I mentioned my code is working with v4.9.0 normally, once I upgrade to v4.10.0 I get the error above. This is the actual options object I am using. I will try to remove one option at a time to see what is causing the issue.
const options = {
providerOptions: {
drive: {
key: UPPY_COMPANION_GOOGLE_DRIVE_KEY,
secret: UPPY_COMPANION_GOOGLE_DRIVE_SECRET,
},
},
s3: {
getKey,
key: AWS_KEY,
secret: AWS_SECRET,
bucket: AWS_S3_UPLOADS_BUCKET,
region: AWS_S3_REGION,
acl: "private",
},
server: {
host,
protocol,
path: apiRoutes.upload,
},
filePath: "/tmp",
secret: UPPY_COMPANION_SECRET_KEY,
debug: !isProd,
uploadUrls: [
"https://dom.org",
"https://qa-dom.org"
],
maxFileSize,
};
from uppy.
we can reopen this if you can make a simple code the reproduces the problem
from uppy.
@mifi - can we reopen this? I'm facing the same issue.
Or at least can you point us to how we can debug this some more locally so we can share some more helpful info.
from uppy.
we can reopen this if you can make a simple code the reproduces the problem
from uppy.
I'm also getting the same issue, i'm using type script and using this example code https://github.com/transloadit/uppy/blob/main/examples/uppy-with-companion/server/index.js
const { app: companionApp } = companion.app(companionOptions)
app.use(companionApp)
companion.socket(app.listen(3020))
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option src/index.ts:22:39
/Users/sagarg/Documents/proj/tus-directory-server/src/index.ts:183
const { app: companionApp } = companion.app(companionOptions) as any
^
from uppy.
OK, so it seems like the issue is due to incorrectly importing companion from ESM. If you used the example code directly as CJS (require) it would work I guess.
from uppy.
Related Issues (20)
- @transloadit/prettier-bytes 0.3.3 not working with webpack HOT 7
- uppy pauseResume throw unhandled error HOT 2
- Disable browse file / drag and drop on uppy dashboard HOT 2
- Can't resolve '@uppy/core/lib/UploaderPlugin.js HOT 10
- Errors in TypeScript definitions when installed with pnpm HOT 5
- Latest version of @uppy/xhr-upload doesn't support PATCH method HOT 11
- aws-s3-multipart + golden retriever HOT 3
- Event listener that fires before file upload process starts HOT 4
- Drag & Drop not working HOT 1
- Uppy Dashboard does not respect the size of the screen HOT 2
- Dashboard progress icon overlaps with `Remove file` button HOT 1
- Allow unique `id` for React `DragDrop` component HOT 1
- Resume failed with aws-s3-multipart and shouldUseMultipart = true option HOT 1
- New provider views + disabling GoogleDrive "shared drives"
- Wrong font in <Dashboard/> example on https://uppy.io/examples
- Support for Angular 17 HOT 2
- Adding COMPANION_SECRET does not pick up the secret value HOT 1
- use globalThis rather than window HOT 2
- Minio xml result response ends in new upload retry HOT 4
- [4.x] fa_IR locale missing export default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uppy.