Code Monkey home page Code Monkey logo

tweet-to-image's Introduction

Tweet to Image

Tweet to Image — Download a Tweet as an Instagram-Ready Image

tweet-to-image's People

Contributors

clydedz avatar

Watchers

 avatar

tweet-to-image's Issues

[Bug]: Image not downloading as PNG on iPad

Please explain the issue and what was your expectation

When I click the "Download tweet as an image" button from an iPad device, it tries to download a document that's Zero KB. If I open that in the Downloads folder, it's still a document that's Zero KB instead of a PNG image. It has the randomly generated file name and tries to download a file with the name random-name.png.txt (in Safari) and random-name.png (in Chrome). I'm not sure why it's appending .txt in Safari.

This behaviour can be tested on this site - https://clydedz.github.io/tweet-to-image/.

This issue is being tracked in the original library here - bubkoo/html-to-image#287.

Please elaborate the steps to reproduce the issue

  1. Open the site https://clydedz.github.io/tweet-to-image/ on Chrome (and also try Safari) on your iPad device.
  2. Click on the "Download tweet as an image" button.
  3. Confirm if an image is downloaded or something else.

Browser information

Chrome 103.05060.63

[Bug]: Support for the experimental syntax jsx isn't currently enabled

Please explain the issue and what was your expectation

I created this app using the create react app command with the TypeScript command. The test files should automatically work, but they didn't. This issue reminds me to add tests to the app once this issue is fixed.

The main issue is being tracked in the library here - facebook/create-react-app#11700

Please elaborate the steps to reproduce the issue

Add a sample test file with the contents below.

import { render } from "@testing-library/react";

test('test', ()=> {
    render(<div>test</div>);
    expect(1).toBe(1);
});

Running the test produces the following output in the console.

Test suite failed to run

    Jest encountered an unexpected token

    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.

    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.

    By default "node_modules" folder is ignored by transformers.

    Here's what you can do:
     • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
     • If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.       

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/configuration
    For information about custom transformations, see:
    https://jestjs.io/docs/code-transformation

    Details:

    SyntaxError: F:\Code\tweet-to-image\src\App.test.tsx: Support for the experimental syntax 'jsx' isn't currently enabled (4:12):

      2 |
      3 | test('fefe', ()=> {
    > 4 |     render(<div>fefe</div>);
        |            ^
      5 |     expect(1).toBe(1);
      6 | });
      7 |

    Add @babel/preset-react (https://github.com/babel/babel/tree/main/packages/babel-preset-react) to the 'presets' section of your Babel config to enable transformation.
    If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-jsx) to the 'plugins' section to enable parsing.

      at instantiate (node_modules/@babel/parser/src/parse-error/credentials.js:61:22)
      at toParseError (node_modules/@babel/parser/src/parse-error.js:58:12)
      at Parser.raise (node_modules/@babel/parser/src/tokenizer/index.js:1736:19)
      at Parser.expectOnePlugin (node_modules/@babel/parser/src/tokenizer/index.js:1800:18)
      at Parser.parseExprAtom (node_modules/@babel/parser/src/parser/expression.js:1239:16)
      at Parser.parseExprSubscripts (node_modules/@babel/parser/src/parser/expression.js:684:23)
      at Parser.parseUpdate (node_modules/@babel/parser/src/parser/expression.js:663:21)
      at Parser.parseMaybeUnary (node_modules/@babel/parser/src/parser/expression.js:632:23)
      at Parser.parseMaybeUnaryOrPrivate (node_modules/@babel/parser/src/parser/expression.js:384:14)
      at Parser.parseExprOps (node_modules/@babel/parser/src/parser/expression.js:394:23)

Browser information

N/A

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.