Comments (11)
Hello! I have a smiliar issue!
Just created my first kit, installed it via NPM and wanted to import it so my Angular project:
import { all } from '@awesome.me/kit-{my_kit_id}/icons'
and then I get this error both in my IDE and during the build:
TS2307: Cannot find module @awesome.me/kit-{my_kit_id}/icons or its corresponding type declarations.
This is what the package.json
of the NPM module looks like:
{
"description": "Kit {my_kit_id}",
"keywords": [],
"engines": {
"node": ">=16"
},
"dependencies": {
"@fortawesome/fontawesome-common-types": "^6.5.1"
},
"version": "1.0.13",
"name": "@awesome.me/kit-{my_kit_id}",
"main": "index.js",
"types": "./index.d.ts",
"license": "UNLICENSED",
"private": true,
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.js",
"default": "./index.js"
},
"./icons": {
"types": "./icons/modules/index.d.ts",
"import": "./icons/modules/index.mjs",
"require": "./icons/modules/index.js",
"default": "./icons/modules/index.js"
},
"./icons/classic/light": {
"types": "./icons/modules/classic/light.d.ts",
"import": "./icons/modules/classic/light.mjs",
"require": "./icons/modules/classic/light.js",
"default": "./icons/modules/classic/light.js"
},
"./icons/classic/solid": {
"types": "./icons/modules/classic/solid.d.ts",
"import": "./icons/modules/classic/solid.mjs",
"require": "./icons/modules/classic/solid.js",
"default": "./icons/modules/classic/solid.js"
},
"./icons/css/*.css": {
"default": "./icons/css/*.css"
},
"./icons/less/*.less": {
"default": "./icons/less/*.less"
},
"./icons/scss/*.scss": {
"default": "./icons/scss/*.scss"
},
"./icons/webfonts/*.woff2": {
"default": "./icons/webfonts/*.woff2"
},
"./icons/webfonts/*.ttf": {
"default": "./icons/webfonts/*.ttf"
},
"./package.json": "./package.json"
}
}
from font-awesome.
@bchoubert I'll close it. If something else pops back up we can always reopen. I have a feeling this is not the last packaging + Typescript issue we'll run across.
from font-awesome.
Hello everyone! Can anyone supporte here? This is kind of a blocking problem for my project right now and I appreciaty any help :) @tagliala @robmadole
from font-awesome.
On my side, I consider it solved too!
I needed, for my NextJS Project, to set module=esnext and modulerResolution=Node16.
Thanks a lot @robmadole ! Should I mark this as solved?
from font-awesome.
π Hi all. So we are getting some other reports of this and the issue is Typescript moduleResolution
. This needs to be set to node16
to support the newer exports
feature of package.json.
Give this a try and see if it "resolves" the problem. (Pun intended.)
from font-awesome.
@robmadole Thanks for your support here! Setting the value to node16
fixes the import error. But as I'm working with Angular 17 this setting causes other problems. For example this error:
TS1479: The current file is a CommonJS module whose imports will produce require calls; however, the referenced file is an ECMAScript module and cannot be imported with require. Consider writing a dynamic import(@angular/core)' call instead.
from font-awesome.
@devoto13 have you ran into problems with Angular 17 and packages that use the newish "exports" feature of package.json? Off the top of your head am I missing something here?
from font-awesome.
Haven't tested, but I don't think moduleResolution=node16 is a good choice for Angular as it is bundled and I am not sure node16 would work correctly in this scenario. Perhaps one should use moduleResolution=bundler as suggested in angular/angular#46181 (comment)?
from font-awesome.
@devoto13 good to know! Thank you. @hagealex can you try bundler
?
from font-awesome.
@robmadole Using bundler
seems to work. No issues so far! Will make a further test tomorrow but for the moment it looks like it's solved. Thank you so much!
from font-awesome.
Awesome. Let us know if you find something else.
from font-awesome.
Related Issues (20)
- [bug] Desktop font: file-pdf becomes file-png HOT 3
- Icon request: Flower of Life HOT 3
- Feature request: onload event listener for specific icons
- Icon request: arrow-up-arrow-down-idle
- Icon request: icon-microscope HOT 1
- Icon request: configure-tables-icon HOT 1
- Bug: Module β./icons/modules/classic/regularβ Not Found in Package Exports HOT 3
- Icon request: icon-name HOT 1
- Icon request: maimai (θθοΌi.e. linkedin equivalent in china
- Bug: cannot find name "IconDefinition" HOT 6
- Icon is loaded with data-prefix "fal" but seconds after changed to "fas" HOT 1
- Icon Request: fa-x(twitter) HOT 2
- Icon request: bionic-reading HOT 1
- Icon request: bionic-reading HOT 1
- Icon request: icon-kotlin HOT 1
- Feature request: Don't respect "prefers-reduced-motion" for loading spinners HOT 1
- Icon request: flutter HOT 1
- Icon request: drive through
- License UNKNOWN in pip package HOT 1
- Icon request: fa-magnifying-glass-book HOT 1
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 font-awesome.