Code Monkey home page Code Monkey logo

api-plugin-files's People

Contributors

akarshit avatar brent-hoover avatar delagroove avatar dependabot[bot] avatar focusaurus avatar kieckhafer avatar mikemurray avatar mohannarayana avatar mpaktiti avatar snyk-bot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api-plugin-files's Issues

product upload image broken

Are you looking for help with getting started on Reaction? Please visit our Reaction documentation.

Issue Description

tried uploading jpeg and png files to product image.

shows up a blank image in media gallery.

Steps to Reproduce

create product, upload product image

Possible Solution

media items show up in

{
"_id" : "MZF7qKCw94k2Bhuw2",
"metadata" : {
"priority" : 2,
"productId" : "SWBP6se8drwdWYBZd",
"variantId" : "WWAnoQhoJTtpM3Dvn",
"ownerId" : "dDGjoKDjMNv4SvhhG",
"shopId" : "5cQ3KnALddhPpJkin",
"workflow" : "published"
},
"original" : {
"name" : "Screenshot 2020-03-26 at 2.08.12 PM.png",
"size" : 19940,
"tempStoreId" : "d21d0441704c6bfa8c9137a7b2a59e6d",
"type" : "image/png",
"updatedAt" : ISODate("2020-03-26T06:08:18.309Z"),
"uploadedAt" : ISODate("2020-03-27T08:46:24.446Z")
}
}

in Catalog, shows up as

			"media" : [
				{
					"priority" : 1,
					"productId" : "SWBP6se8drwdWYBZd",
					"variantId" : "WWAnoQhoJTtpM3Dvn",
					"URLs" : {
						"large" : "null",
						"medium" : "null",
						"original" : "null",
						"small" : "null",
						"thumbnail" : "null"
					}
				},
				{
					"priority" : 2,
					"productId" : "SWBP6se8drwdWYBZd",
					"variantId" : "WWAnoQhoJTtpM3Dvn",
					"URLs" : {
						"large" : "null",
						"medium" : "null",
						"original" : "null",
						"small" : "null",
						"thumbnail" : "null"
					}
				}
			],
			"metafields" : null,

Versions

Error: Input buffer contains unsupported image format

==> typeDefault
api_1    |  image/jpeg jpg image/jpeg 
api_1    |  
api_1    | 11:35:02.082Z  INFO Reaction: After transformWrite file info is { name: 'WWuTm5nfvKx38A3yd.jpg', type: 'image/jpeg' }
api_1    | 11:35:02.083Z  INFO Reaction: S3Store _fileKeyMaker fileRecord info: { name: 'WWuTm5nfvKx38A3yd.jpg', type: 'image/jpeg' }
api_1    | 11:35:02.084Z  INFO Reaction: S3Store _fileKeyMaker fileRecord size: 38
api_1    | ReactionError: Error: Input buffer contains unsupported image format
api_1    |     at Sharp.<anonymous> (file:///usr/local/src/app/node_modules/api-plugin-files/src/utils/transformWrite.js:37:11)
api_1    |     at Sharp.emit (events.js:223:5)
api_1    |     at Sharp.EventEmitter.emit (domain.js:475:20)
api_1    |     at /usr/local/src/app/node_modules/sharp/lib/output.js:707:18 {
api_1    |   eventData: {},
api_1    |   error: 'error-sharp-resize-internal',
api_1    |   isClientSafe: true,
api_1    |   reason: [Error: Input buffer contains unsupported image format],
api_1    |   details: {}
api_1    | }

The Solution is here

0ca95a3

Cannot find package `api-plugin-files` locally

api_1    | (node:105) ExperimentalWarning: The ESM module loader is experimental.
api_1    | 17:52:00.795Z ERROR Reaction: Cannot find package 'api-plugin-files' imported from /usr/local/src/app/node_modules/@reactioncommerce/api-core/src/importPluginsJSONFile.js
api_1    |   Error: Cannot find package 'api-plugin-files' imported from /usr/local/src/app/node_modules/@reactioncommerce/api-core/src/importPluginsJSONFile.js
api_1    |       at Loader.resolve [as _resolve] (internal/modules/esm/default_resolve.js:84:13)
api_1    |       at Loader.resolve (internal/modules/esm/loader.js:73:33)
api_1    |       at Loader.getModuleJob (internal/modules/esm/loader.js:147:40)
api_1    |       at Loader.import (internal/modules/esm/loader.js:131:28)
api_1    |       at importModuleDynamically (internal/modules/esm/translators.js:75:23)
api_1    | [nodemon] app crashed - waiting for file changes before starting...

Prerequisites

  • [ *] Are you running the latest version?
  • Are you able to consistently reproduce the issue?
  • [ *] Did you search the issue queue for existing issue? [Search issues]

Steps to Reproduce

  1. Install the plugin locally
  2. after creating a blug to forget a file to declare or something.

Possible Solution

the core it looks for plugins in docker container first

Versions

{
  'reaction-identity': '3.0.0',
  npm: '6.14.4',
  ares: '1.16.0',
  brotli: '1.0.7',
  cldr: '37.0',
  http_parser: '2.9.3',
  icu: '67.1',
  llhttp: '2.0.4',
  modules: '72',
  napi: '6',
  nghttp2: '1.41.0',
  node: '12.18.0',
  openssl: '1.1.1g',
  tz: '2019c',
  unicode: '13.0',
  uv: '1.37.0',
  v8: '7.8.279.23-node.37',
  zlib: '1.2.11'
}

GridStore is deprecated, and will be removed in a future version. Please use GridFSBucket instead

(node:75) DeprecationWarning: GridStore is deprecated, and will be removed in a future version. Please use GridFSBucket instead
api_1    | (node:75) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
api_1    | ReactionError: Error: Input buffer contains unsupported image format
api_1    |     at Sharp.<anonymous> (file:///usr/local/src/app/node_modules/api-plugin-files/src/setUpFileCollections.js:99:19)
api_1    |     at Sharp.emit (events.js:223:5)
api_1    |     at Sharp.EventEmitter.emit (domain.js:475:20)
api_1    |     at /usr/local/src/app/node_modules/sharp/lib/output.js:707:18 {
api_1    |   eventData: {},
api_1    |   error: 'error-sharp-resize-internal',
api_1    |   isClientSafe: true,
api_1    |   reason: [Error: Input buffer contains unsupported image format],
api_1    |   details: {}
api_1    | }
api_1    | 19:53:24.757Z  INFO Reaction: Stopping Reaction API...
api_1    | 19:53:24.758Z  INFO Reaction: Running shutdown function "jobQueueShutdown" for plugin "job-queue"...
api_1    | Failing 1 jobs on queue stop.
api_1    | 19:53:24.765Z  INFO Reaction: Shutdown function "jobQueueShutdown" for plugin "job-queue" finished in 6ms
api_1    | 19:53:24.775Z  INFO Reaction: Reaction API stopped
api_1    | [nodemon] app crashed - waiting for file changes before starting...

Issue Description

Steps to Reproduce

  1. Put A image in diroctory public
  2. Save image by calling it through url by using fileRecord = await FileRecord.fromUrl(fileUrl, { fetch });

Possible Solution

Versions

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.