Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image tag not working inside the jsx (React-template) #91

Open
prasoon0909 opened this issue Aug 4, 2023 · 1 comment
Open

Image tag not working inside the jsx (React-template) #91

prasoon0909 opened this issue Aug 4, 2023 · 1 comment

Comments

@prasoon0909
Copy link

I am trying to insert my brand logo inside react component using image tag but it doesn't seems to be working although i can see image tag in the element section of chrome dev tool.

import React from "react";
import "./style.css";

export default function Home() {
  return (
    <div className="home-div">
      <image
        width="500"
        class="home-image"
        alt="ImageKit.io"
        src="https://raw.githubusercontent.com/imagekit-developer/imagekit-javascript/master/assets/imagekit-light-logo.svg"
      />
      <h1 className="home-heading">Connect to Imagekit</h1>
      <sp-button class="home-button">Next</sp-button>
      <p className="home-info">
        This step opens a window where you can securely enter your Imagekit
        credentials, which will enable Adobe PhotoShop to access your Imagekit
        account.
      </p>
    </div>
  );
}

What this renders to :-
Screenshot 2023-08-04 at 12 58 42 PM

weppack.config.js

const path = require("path");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");

module.exports = {
    entry: './src/index.jsx',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'index.js',
        //libraryTarget: "commonjs2"
    },
    devtool: 'eval-cheap-source-map', // won't work on XD due to lack of eval
    externals: {
        uxp: 'commonjs2 uxp',
        photoshop: 'commonjs2 photoshop',
        os: 'commonjs2 os'
    },
    resolve: {
        extensions: [".js", ".jsx"]
    },
    module: {
        rules: [
            {
                test: /\.jsx?$/,
                exclude: /node_modules/,
                loader: "babel-loader",
                options: {
                    plugins: [
                        "@babel/transform-react-jsx",
                        "@babel/proposal-object-rest-spread",
                        "@babel/plugin-syntax-class-properties",
                    ]
                }
            },
            {
                test: /\.png$/,
                exclude: /node_modules/,
                loader: 'file-loader'
            },
            {
                test: /\.css$/,
                use: ["style-loader", "css-loader"]
            }
        ]
    },
    plugins: [
        //new CleanWebpackPlugin(),
        new CopyPlugin(['plugin'], {
            copyUnmodified: true
        })
    ]
};
@dennismoha
Copy link

Have you tried including permission for that link in the manifest.json? I see you are using a network link for the image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants