Code Monkey home page Code Monkey logo

Comments (5)

vishal423 avatar vishal423 commented on September 21, 2024

v0.10.0 includes a change to use ESM import for fontawesome icons. Can you try that or latest version 0.10.2 to see if that fixes the above issue?

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on September 21, 2024

@littlepine, did you get chance to try out the latest version?

from generator-jhipster-svelte.

littlepine avatar littlepine commented on September 21, 2024

@vishal423 thank you very much for your response.

Let me test it later.

from generator-jhipster-svelte.

littlepine avatar littlepine commented on September 21, 2024

Oh, sorry, I just figure out the version I am using is already 0.10.2

Here I also attach my .yo-rc for reference

{
	"generator-jhipster": {
		"applicationIndex": 0,
		"applicationType": "monolith",
		"authenticationType": "oauth2",
		"baseName": "vpair",
		"blueprints": [
			{
				"name": "generator-jhipster-svelte",
				"version": "0.10.2"
			}
		],
		"buildTool": "gradle",
		"cacheProvider": "ehcache",
		"clientFramework": "svelte",
		"clientPackageManager": "npm",
		"clientTheme": "minty",
		"clientThemeVariant": "primary",
		"creationTimestamp": 1667237633479,
		"databaseType": "sql",
		"devDatabaseType": "mariadb",
		"devServerPort": 9060,
		"dtoSuffix": "DTO",
		"enableGradleEnterprise": false,
		"enableHibernateCache": true,
		"enableSwaggerCodegen": false,
		"enableTranslation": false,
		"entities": [
			"SystemSetting",
			"MultiLangString",
			"Address",
			"Member",
			"Company",
			"PropertyPost",
			"SearchedQuery",
			"Membership"
		],
		"entitySuffix": "",
		"gradleEnterpriseHost": "",
		"jhiPrefix": "vpr",
		"jhipsterVersion": "7.9.3",
		"languages": ["en"],
		"messageBroker": false,
		"nativeLanguage": "zh-tw",
		"otherModules": [
			{
				"name": "generator-jhipster-svelte",
				"version": "0.10.2"
			}
		],
		"packageFolder": "hk/com/justmove/platform/vpair",
		"packageName": "hk.com.justmove.platform.vpair",
		"pages": [],
		"prodDatabaseType": "mariadb",
		"reactive": false,
		"searchEngine": "elasticsearch",
		"serverPort": "8080",
		"serviceDiscoveryType": false,
		"skipCheckLengthOfIdentifier": false,
		"skipClient": false,
		"skipFakeData": false,
		"skipServer": true,
		"skipUserManagement": true,
		"testFrameworks": ["cypress"],
		"websocket": false,
		"withAdminUi": true
	},
	"generator-jhipster-svelte": {
		"swaggerUi": false,
		"version": "0.10.2"
	}
}

And acturally I have applied my own fix on that, which is not quite alegant through.

Here is what I did:

I installed the "svelte-fa" package to the jhipster-svelte-library project.
Then replaced all the <Icon tags to <Fa and the icon problem fixed.

And I attach part of my patch here also for your reference:

diff --git a/node_modules/jhipster-svelte-library/input-control.svelte b/node_modules/jhipster-svelte-library/input-control.svelte
index 5652ee4..7d8beff 100644
--- a/node_modules/jhipster-svelte-library/input-control.svelte
+++ b/node_modules/jhipster-svelte-library/input-control.svelte
@@ -1,5 +1,6 @@
 <script>
 	import { afterUpdate, createEventDispatcher } from 'svelte'
+	import Fa from 'svelte-fa'
 	import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons/faExclamationCircle'
 	import { faTimes } from '@fortawesome/free-solid-svg-icons/faTimes'
 
@@ -150,7 +151,7 @@
 					ref.dispatchEvent(new Event('change'))
 				}}"
 			>
-				<Icon classes="mr-2" icon="{faTimes}" />
+				<Fa classes="mr-2" icon="{faTimes}" />
 			</Button>
 		{/if}
 	{:else}
@@ -182,7 +183,7 @@
 	<slot message="{message}" dirty="{dirty}" valid="{valid}">
 		{#if dirty && !valid}
 			<div data-testid="{name}-error" class="flex items-center">
-				<Icon classes="mr-2" icon="{faExclamationCircle}" />
+				<Fa classes="mr-2" icon="{faExclamationCircle}" />
 				{message}
 			</div>
 		{:else}&nbsp;{/if}

If you don't mind, I can contribute on the fix.

Again, thank you very much for the effort on creating this blueprint and it helps me a lot on learning svelte.

from generator-jhipster-svelte.

vishal423 avatar vishal423 commented on September 21, 2024

@littlepine, it seems I missed the ESM change on the library side and hence the issue. Your help is much appreciated. I believe changing the import from import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons/faExclamationCircle' to import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons' should fix the issue.

While doing this, you can also combine multiple import statements like import { faExclamationCircle, faTimes } from '@fortawesome/free-solid-svg-icons'.

Please note this change needs to be done across all references on library side https://github.com/vishal423/jhipster-svelte-library/search?q=from+%27%40fortawesome%2Ffree-solid-svg-icons%27

from generator-jhipster-svelte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.