SoftwareBrothers / adminjs-import-export

MIT License
5 stars 25 forks source link

Import not working with mongoose on fastify #26

Open dhbahr opened 1 year ago

dhbahr commented 1 year ago

As per the title, export works just fine as far as I can tell, import however reports that it has been successful, but nothing really happens.

package.json:

  "type": "module",
  "name": "tmp",
  "description": "This project was bootstrapped with Fastify-CLI.",
  "version": "1.0.0",
  "main": "app.js",
  "directories": {
    "test": "test"
  },
  "scripts": {
    "test": "tap \"test/**/*.test.js\"",
    "start": "fastify start -l info app.js",
    "dev": "fastify start -w -l info -P app.js",
    "lint": "standard",
    "lint:fix": "standard --fix"
  },
  "eslintConfig": {
    "extends": "fastify"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@adminjs/fastify": "^4.0.1",
    "@adminjs/import-export": "^3.0.0",
    "@adminjs/mongoose": "^4.0.0",
    "@aws-sdk/client-s3": "^3.373.0",
    "@fastify/auth": "^4.3.0",
    "@fastify/autoload": "^5.0.0",
    "@fastify/bearer-auth": "^9.0.0",
    "@fastify/cors": "^8.3.0",
    "@fastify/mongodb": "^7.0.0",
    "@fastify/sensible": "^5.0.0",
    "adminjs": "^7.0.9",
    "bcryptjs": "^2.4.3",
    "crypto-random-string": "^5.0.0",
    "fastify": "^4.18.0",
    "fastify-cli": "^5.7.1",
    "fastify-plugin": "^4.5.0",
    "mongoose": "^7.3.1"
  },
  "devDependencies": {
    "@istanbuljs/esm-loader-hook": "0.2.0",
    "husky": "^8.0.3",
    "standard": "^17.1.0",
    "tap": "^16.1.0"
  },
  "tap": {
    "node-arg": [
      "--no-warnings",
      "--experimental-loader",
      "@istanbuljs/esm-loader-hook"
    ]
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run lint:fix"
    }
  }
}
deepaktsw commented 1 year ago

+1

Looking into the networks tab, it appears that the import call returns an error saying that no file was uploaded.

image

{
    "record": {
        "params": {},
        "populated": {},
        "baseError": null,
        "errors": {
            "file": {
                "message": "No file uploaded"
            }
        }
    },
    "records": [],
    "notice": {
        "message": "thereWereValidationErrors",
        "type": "error"
    }
}

However in the payload I can see that the file was sent in it - image

Any help here is appreciated!

martinhahn commented 1 year ago

Any news on this? @JonaszJestem @dziraf @AdamFrydrychRST

dhbahr commented 1 year ago

The silence really is quite disappointing...

martinhahn commented 1 year ago

Any news on this? @JonaszJestem @dziraf @AdamFrydrychRST