squircle-js
squircle-js copied to clipboard
Incorrect entry in the package.json
trafficstars
When trying to use the package in Vite, the following error is encountered:
[vite] Internal server error: Failed to resolve entry for package "@squircle-js/react". The package may have incorrect main/module/exports specified in its package.json
Apparently this is because the output in the dist changed:
.
├── dist
│ ├── index.cjs
│ ├── index.d.cts
│ ├── index.d.ts
│ └── index.js
└── src
└── index.tsx
while in the package.json this is specified:
{
"name": "@squircle-js/react",
"version": "1.2.17",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts"
}
For anyone who needs this here's a hot fix for Vite-based projects:
resolve: {
alias: {
"@squircle-js/react":
"node_modules/@squircle-js/react/dist/index.js",
},
}
Thanks for the issue, will be fixed with #31
Fixed, please update to latest version 🙏
thank you! 🙌🏻