Skip to content

How to use this project - not working #1027

@ghost

Description

I mean, there is something wrong with the way you set up exports in your package.json.

How to import a single icon from this package?
The same applies to @tabler/icons-png, how to import any image? It doesn't work, while importing a single image works in every other project.
You need to give attention to this. Your tutorial in the readme.md doesn't work,

I continuously read the following error message:
Failed to resolve import "@tabler/icons/icons" from "src/app.js". Does the file exist?

when I do: import {IconAbc} from '@tabler/icons/icons';

And

Failed to resolve entry for package "@tabler/icons". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "@tabler/icons" package

when I do: import {IconAbc} from '@tabler/icons';

I am using Vite as package builder. But this problem happens without Vite also.

Related, but not directly, is: considering that all projects are migrating to only .mjs instead of .cjs, it would be handy if you could simplify your package.json to potentially remove this complex exports and aliases for different formats, that is the cause of error. I refer to this:

"main": "dist/cjs/tabler-icons.js",
"main:umd": "dist/umd/tabler-icons.js",
"exports": {
"./": [
"./icons/
"
]
},
"module": "dist/esm/tabler-icons.js",

Problem mentioned several times:

vitejs/vite#15550

vitejs/vite#3250

"@tabler/icons doesn't have icons/settings.svg specified in their exports field. So it is hidden from external users. Vite is working as expected."

https://github.com/vitejs/vite/issues?q=is%3Aissue+tabler+is%3Aclosed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions