<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arthur Abeilice</title>
    <description>The latest articles on DEV Community by Arthur Abeilice (@afa7789).</description>
    <link>https://dev.to/afa7789</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F928977%2F5745e240-847b-4f47-badb-54f19d08b34b.jpeg</url>
      <title>DEV Community: Arthur Abeilice</title>
      <link>https://dev.to/afa7789</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/afa7789"/>
    <language>en</language>
    <item>
      <title>While in React I can't resolve with webpack custom module that was forked</title>
      <dc:creator>Arthur Abeilice</dc:creator>
      <pubDate>Mon, 19 Sep 2022 18:09:44 +0000</pubDate>
      <link>https://dev.to/afa7789/while-in-react-i-cant-resolve-with-webpack-custom-module-that-was-forked-26m0</link>
      <guid>https://dev.to/afa7789/while-in-react-i-cant-resolve-with-webpack-custom-module-that-was-forked-26m0</guid>
      <description>&lt;p&gt;I"m trying to use a custom library but I can't see to be able to use when the webpack runs. I already added it to the fallback assign and a new resolve extensions, but couldn't make it work:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;config.resolve.extensions = ['.ts','.tsx','.js','.jsx'],&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is the component I'm adding it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import {AvatarComponent} from '@rainbow-me/rainbowkit';
import makeGradient from 'ethereum-gradient-base64';

export const CustomAvatar: AvatarComponent = ({ address, ensImage, size }) =&amp;gt; {
    const image = makeGradient(address);
    return ensImage ? (
      &amp;lt;img
        src={ensImage}
        width={size}
        height={size}
        style={{ borderRadius: 999 }}
      /&amp;gt;
    ) : (
      &amp;lt;div&amp;gt;
        &amp;lt;img
            src={image}
            width={size}
            height={size}
            style={{ borderRadius: 999 }}
        /&amp;gt;
      &amp;lt;/div&amp;gt;
    );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Error it shows me at terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Failed to compile.
Module not found: Error: Can't resolve 'ethereum-gradient-base64' in '/home/afa/Documents/code/others/PROJECTS/wagrk/src/Components/Web3'

ERROR in ./src/Components/Web3/CustomAvatar.tsx 4:0-52
Module not found: Error: Can't resolve 'ethereum-gradient-base64' in '/home/afa/Documents/code/others/PROJECTS/wagrk/src/Components/Web3'

webpack compiled with 1 error
No issues found.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this is my tsconfig:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "include": [
        "./src/**/*"
    ],
    "compilerOptions": {
        "moduleResolution": "node",
        "strict": true,
        "esModuleInterop": true,
        "isolatedModules": true,
        "lib": [
            "dom",
            "es2015"
        ],
        "jsx": "react-jsx",
    },
    "exclude": ["node_modules"]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and this is my config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const webpack = require('webpack');

module.exports = function override(config) {
    const fallback = config.resolve.fallback || {};
    Object.assign(fallback, {
        "crypto": require.resolve("crypto-browserify"),
        "stream": require.resolve("stream-browserify"),
        "assert": require.resolve("assert"),
        "http": require.resolve("stream-http"),
        "https": require.resolve("https-browserify"),
        "os": require.resolve("os-browserify"),
        "url": require.resolve("url")
    })
    config.ignoreWarnings = [/Failed to parse source map/];
    config.resolve.fallback = fallback;
    config.resolve.extensions = ['.ts','.tsx','.js','.jsx'],
    config.plugins = (config.plugins || []).concat([
        new webpack.ProvidePlugin({
            process: 'process/browser',
            Buffer: ['buffer', 'Buffer']
        })
    ])
    return config;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Links: Repo That I'm making the error demo: &lt;a href="https://github.com/afa7789/wagrk"&gt;https://github.com/afa7789/wagrk&lt;/a&gt; &lt;a href="https://github.com/afa7789/ethereum-gradient-base64/"&gt;https://github.com/afa7789/ethereum-gradient-base64/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
