Open bennyvenassi opened 3 years ago
Hi Bennyvenassi,
I [partially] fixed this error adding a custom webpack and a special loader for the svg files:
This is my custom-webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},
{
test: /\.(svg)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},
],
},
};
I can actually get the popup working but the rendered svg are marked as "unsafe" in the DOM.
I'm still trying to find a solution
If I modify manually the DOM I can successfully see the svg resource:
I have the same/similar issue in an Ionic/Capacitor app.
`Error: ./node_modules/@mindsorg/web3modal-ts/dist/providers/injected/index.js 4:53 Module parse failed: Unexpected token (4:53) File was processed with these loaders:
logo: new URL('../logos/web3-default.svg', import.meta.url),
| type: 'injected', | check: 'isWeb3', @ ./node_modules/@mindsorg/web3modal-ts/dist/providers/index.js 2:0-39 4:0-43 @ ./node_modules/@mindsorg/web3modal-ts/dist/index.js @ ./node_modules/@mindsorg/web3modal-angular/__ivy_ngcc__/fesm2015/mindsorg-web3modal-angular.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi ./src/main.ts`
Then the same message is repeated for @mindsorg/web3modal-ts/dist/providers/providers/index.js
I have the same/similar issue in an Ionic/Capacitor app.
`Error: ./node_modules/@mindsorg/web3modal-ts/dist/providers/injected/index.js 4:53 Module parse failed: Unexpected token (4:53) File was processed with these loaders:
* ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js * ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js * ./node_modules/@ngtools/webpack/src/ivy/index.js You may need an additional loader to handle the result of these loaders. | id: 'injected', | name: 'Web3',
logo: new URL('../logos/web3-default.svg', import.meta.url),
| type: 'injected', | check: 'isWeb3', @ ./node_modules/@mindsorg/web3modal-ts/dist/providers/index.js 2:0-39 4:0-43 @ ./node_modules/@mindsorg/web3modal-ts/dist/index.js @ ./node_modules/@mindsorg/web3modal-angular/ivy_ngcc/fesm2015/mindsorg-web3modal-angular.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi ./src/main.ts`
Then the same message is repeated for @mindsorg/web3modal-ts/dist/providers/providers/index.js
@gianlucamazza shows the solution to this issue in Angular. With a custom webpack loader it's working. Also in ionic. Nevertheless it would be great, that the web3modal would be working without this workaround.
Hello, I'm also experiencing the above issue.
Here's my custom-webpack.config.js file.
module.exports = {
module: {
rules: [
{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},
{
test: /\.(svg)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 8192,
},
},
],
},
],
},
};
Any idea what might be going on?
Hi Guys,
I'm trying to use your module inside an angular 12 project. Unfortunately the app won't compile, because of this issue:
This error appears for all svg files in the web3modal-angular module.
Thank you for your help!