Giter Site home page Giter Site logo

Comments (8)

sagargg avatar sagargg commented on June 16, 2024 2

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.

mifi avatar mifi commented on June 16, 2024

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.

MoustafaWehbe avatar MoustafaWehbe commented on June 16, 2024

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.

mifi avatar mifi commented on June 16, 2024

we can reopen this if you can make a simple code the reproduces the problem

from uppy.

chrisshaddad avatar chrisshaddad commented on June 16, 2024

@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.

mifi avatar mifi commented on June 16, 2024

we can reopen this if you can make a simple code the reproduces the problem

from uppy.

sagargg avatar sagargg commented on June 16, 2024

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.

mifi avatar mifi commented on June 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.