Comments (11)
https://github.com/bpierre/blo/releases/tag/v1.2.0
https://unpkg.com/browse/[email protected]/package.json
https://unpkg.com/browse/[email protected]/dist/
Thanks and please me know if it works 🤗
from blo.
Thank you for a quick fix!
from blo.
Is it with Next.js? Could you please add a way to reproduce the issue? Thanks!
from blo.
@bpierre yes, we use next.js. it's a closed source application so can't reveal more details. but this is our env:
node version: 16.20.0
macos
install blo: npm i -S blo
use:
import { bloSvg } from 'blo';`
...
<img alt={address} src={bloSvg(address)} />
after the page loads, we get that error. lmk if you still need more details (i am a new react dev btw so dont understand much as of now :))
EDIT: thank you for creating this cool library!
from blo.
@abhijeetbhagat I created a new Next.js project with npx create-next-app
and leaving everything by default:
Here is the demo page, everything seems to work for me: https://github.com/bpierre/blo-issue-3/blob/main/src/app/page.tsx
I added you as a collaborator on this repo, could you please try to reproduce your issue there? Thanks!
from blo.
Closing this issue for now, please reopen if you can reproduce on the linked repo :)
from blo.
@bpierre blo
specifies type: 'module'
in package.json
, meaning that any .js
files are treated as ES module. Since the main
file is index.cjs.js
(ends with .js
), it's treated as ES module as well. It's not possible to require
the library because of this in CommonJS environments.
The easiest solution is to name the main
file index.cjs
, which is always treated as CommonJS regardless of the type
in package.json
.
from blo.
@Mrtenz it used to be the case, but it was causing compatibility issues in certain cases (ESLint). This commit changed it: 9ce9aa2
Could you please post a reproduction of your issue somewhere so I can have a look? Thanks 🙏
from blo.
Hi, you can see it's reproduced here on the yarn test:coverage:mocha
step: https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/75930/workflows/2d755ea6-af10-47d9-884d-f5b5c17f2fba/jobs/2611616
After removing "type": "module",
from blo's package.json it works, but not sure if that's the right solution.
Other thing that has worked was to downgrade blo
from 1.1.1 to 1.1.0.
from blo.
Found the issue about ESLint and using the .cjs
extension, it was also with MetaMask/metamask-extension:
@Mrtenz @dan437 Could you confirm having .cjs
works with your ESLint config now? There is no extensions
line in the current .eslintrc.js but it might not be needed anymore?
from blo.
After downgrading to 1.1.0 I can see that blo's package.json uses:
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
}
},
Mocha tests pass and when I run yarn lint
in the MetaMask extension, it passes as well.
from blo.
Related Issues (2)
- circular icons HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blo.