d2-checklist icon indicating copy to clipboard operation
d2-checklist copied to clipboard

Errors Building Project

Open aMytho opened this issue 2 years ago • 2 comments

I'm trying to make some small changes but I'm getting errors when attempting to build the angular project. It seems to be searching for the font awesome modules. It looks like this project uses the paid version which is why its not installed.

Is there a way to disable those icons and build without them? If not what do I need to modify to get this working? I I've tried this with no luck :(

// @ts-ignore

Excerpt from log

✔ Browser application bundle generation complete.

./src/app/service/icon.service.ts:2:0-950 - Error: Module not found: Error: Can't resolve '@fortawesome/pro-light-svg-icons' in 'C:\Users\JMyth\documents\dev\d2-checklist\src\app\service'

./src/app/service/icon.service.ts:3:0-1081 - Error: Module not found: Error: Can't resolve '@fortawesome/pro-regular-svg-icons' in 'C:\Users\JMyth\documents\dev\d2-checklist\src\app\service'

./src/app/service/icon.service.ts:4:0-234 - Error: Module not found: Error: Can't resolve '@fortawesome/pro-duotone-svg-icons' in 'C:\Users\JMyth\documents\dev\d2-checklist\src\app\service'

./src/app/service/icon.service.ts:5:0-2702 - Error: Module not found: Error: Can't resolve '@fortawesome/pro-solid-svg-icons' in 
'C:\Users\JMyth\documents\dev\d2-checklist\src\app\service'

./src/app/service/mark.service.ts:4:0-69 - Error: Module not found: Error: Can't resolve '@fortawesome/pro-regular-svg-icons' in 
'C:\Users\JMyth\documents\dev\d2-checklist\src\app\service'

./src/app/service/mark.service.ts:5:0-6:42 - Error: Module not found: Error: Can't resolve '@fortawesome/pro-solid-svg-icons' in 
'C:\Users\JMyth\documents\dev\d2-checklist\src\app\service'

Error: src/app/service/icon.service.ts:19:8 - error TS2307: Cannot find module '@fortawesome/pro-light-svg-icons' or its corresponding type declarations.

19 } from '@fortawesome/pro-light-svg-icons';
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: src/app/service/icon.service.ts:31:8 - error TS2307: Cannot find module '@fortawesome/pro-regular-svg-icons' or its corresponding type declarations.

31 } from '@fortawesome/pro-regular-svg-icons';
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: src/app/service/icon.service.ts:36:9 - error TS2307: Cannot find module '@fortawesome/pro-duotone-svg-icons' or its corresponding type declarations.

36  } from '@fortawesome/pro-duotone-svg-icons';
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Error: src/app/service/icon.service.ts:78:8 - error TS2307: Cannot find module '@fortawesome/pro-solid-svg-icons' or its corresponding type declarations.

78 } from '@fortawesome/pro-solid-svg-icons';

aMytho avatar Apr 11 '22 23:04 aMytho

Yeah that is a problem =/

I pay for a personal FontAwesome subscription (got in on the original kickstarter).

I think there is a somewhat irritating workaround:

  1. Remove pro-* from package.json
  2. Remove references to pro from the ts files (looks like about 3 of them)
  3. Replace with a free icon alternative.

This is a challenge using the best icons possible while also keep this easily usable open source for folks. I'll see if I can make some changes in the next update to at least make that workaround less painful (possibly w/ a simple comment/uncomment or similar).

dcaslin avatar Apr 12 '22 01:04 dcaslin

I played with it a bit today and managed to find a solution using the workaround. Also found a timesaver with the icon service file.

  1. Remove all pro icons from package.json. Remove package lock file and reinstall all modules.
  2. Remove imports of pro icons. Use a free icon to replace all the now broken icons. I went with the github icon since it was already there. Most files have few references and can be replaced by hand. However, you can use the following regex in vscode for the icon.service.ts file (has hundreds of icons)

Press ctrl+f while on the file. Select the regex button on the search term input. Enter the below regex. You can use a different replacement icon but it has to be imported on the file. image

Regex: =.* Replacement: = fabGithub;

This will auto replace all the icons so you don't have to do it by hand. This will work for now but having an easier method would be great.

aMytho avatar Apr 12 '22 21:04 aMytho