themesberg / flowbite-svelte

Official Svelte components built for Flowbite and Tailwind CSS
https://flowbite-svelte.com
MIT License
2.19k stars 270 forks source link

After updating to version 0.27.15 I can no longer import the flowbite-svelte package #426

Closed 524c closed 1 year ago

524c commented 1 year ago

Describe the bug

Failed to resolve entry for package "flowbite-svelte". The package may have incorrect main/module/exports specified in its package.json.

My code displays this error when trying to use version 0.27.15. With version 0.27.14 the error does not occur. Doing an initial investigation I noticed that package.json (NPM version), does not export any files in this version.

Reproduction

Update flowbite-svelte to version 0.27.15 and try to import.

Flowbite version and System Info

System:
    OS: Linux 5.15 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (4) arm64 Cortex-A72
    Memory: 3.55 GB / 7.63 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.18.0 - ~/.n/bin/node
    Yarn: 1.22.19 - ~/.local/share/pnpm/yarn
    npm: 8.19.2 - ~/.n/bin/npm
  npmPackages:
    @sveltejs/kit: 1.0.0-next.544 => 1.0.0-next.544
    flowbite-svelte: 0.27.15 => 0.27.15
    svelte: ^3.53.1 => 3.53.1
    vite: ^3.2.3 => 3.2.3
dawichi commented 1 year ago

Same error here!

dawichi commented 1 year ago

I'm gonna look at the commits released in 0.27.15 to see if I find what broke it If you find anything, share it!

dawichi commented 1 year ago

https://github.com/themesberg/flowbite-svelte/compare/v0.27.14...v0.27.15

524c commented 1 year ago

I noticed the lack of exports in the package.json of the npm version:

{
    "name": "flowbite-svelte",
    "version": "0.27.15",
    "description": "Flowbite components for Svelte",
    "main": "index.js",
    "author": {
        "name": "Shinichi Okada",
        "email": "connect@codewithshin.com",
        "url": "https://blog.codewithshin.com"
    },
    "bugs": "https://github.com/themesberg/flowbite-svelte/issues",
    "homepage": "https://flowbite-svelte.com/",
    "license": "MIT",
    "scripts": {
        "dev": "vite dev",
        "gen:props": "node ./node_modules/createprops/createprops.js",
        "build": "vite build",
        "package": "svelte-package",
        "preview": "vite preview",
        "test": "playwright test",
        "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
        "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
        "lint": "prettier --check . && eslint .",
        "format": "prettier --write ."
    },
    "devDependencies": {
        "@playwright/test": "^1.25.0",
        "@sveltejs/adapter-vercel": "1.0.0-next.78",
        "@sveltejs/kit": "1.0.0-next.484",
        "@sveltejs/package": "1.0.0-next.3",
        "@typescript-eslint/eslint-plugin": "^5.27.0",
        "@typescript-eslint/parser": "^5.27.0",
        "autoprefixer": "^10.4.7",
        "createprops": "^0.4.9",
        "eslint": "^8.16.0",
        "eslint-config-prettier": "^8.3.0",
        "eslint-plugin-svelte3": "^4.0.0",
        "mdsvex": "^0.10.6",
        "mdsvexamples": "^0.3.2",
        "postcss": "^8.4.14",
        "postcss-load-config": "^4.0.1",
        "prettier": "^2.6.2",
        "prettier-plugin-svelte": "^2.7.0",
        "prism-themes": "^1.9.0",
        "svelte": "^3.44.0",
        "svelte-check": "^2.7.1",
        "svelte-meta-tags": "^2.6.3",
        "svelte-preprocess": "^4.10.7",
        "svelte2tsx": "^0.5.18",
        "tailwindcss": "^3.1.5",
        "tslib": "^2.3.1",
        "typescript": "^4.7.4",
        "vite": "^3.1.0"
    },
    "type": "module",
    "keywords": [
        "svelte",
        "sveltekit",
        "tailwindcss",
        "flowbite",
        "ui",
        "accordion",
        "alert",
        "avatar",
        "badge",
        "breadcrumb",
        "button-group",
        "button",
        "card",
        "carousel",
        "darkmode",
        "dropdown",
        "footer",
        "forms",
        "kbd",
        "list group",
        "mega menu",
        "modal",
        "navbar",
        "pagination",
        "progressbar",
        "rating",
        "sidebar",
        "skeleton",
        "spinner",
        "table",
        "tab",
        "timeline",
        "toast",
        "tooltip",
        "typography",
        "video"
    ],
    "repository": {
        "type": "git",
        "url": "https://github.com/themesberg/flowbite-svelte"
    },
    "dependencies": {
        "@popperjs/core": "^2.11.6",
        "classnames": "^2.3.2",
        "flowbite": "^1.5.3"
    },
    "engines": {
        "npm": ">=7.0.0",
        "node": ">=16.0.0"
    },
    "contributors": [
        "Zoltán Szőgyényi <zoltan@themesberg.com>",
        "Robert Tanislav <robert@themesberg.com>",
        "Victor Cordos <victor@themesberg.com>",
        "Shinichi Okada <okada.shin@gmail.com>",
        "Jakub Jagielka <jjagielka@gmail.com>"
    ]
}
codinkai commented 1 year ago

I do have the same error. Updated from 0.27.8 to 0.27.15 and now I get the error:

Failed to resolve entry for package "flowbite-svelte". The package may have incorrect main/module/exports specified in its package.json.

System: OS: Mac OS Big Sur 11.7.1

shinokada commented 1 year ago

It was my mistake. I'm sorry everyone. I run a wrong command to create a package. (I was working on a different project.) Please update it to the latest version and let me know.

npm i -D flowbite-svelte@latest
524c commented 1 year ago

It was my mistake. I'm sorry everyone. I run a wrong command to create a package. (I was working on a different project.) Please update it to the latest version and let me know.

npm i -D flowbite-svelte@latest

Thanks for the fix 😁