Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - No css file generate #233

Closed
Braintheme opened this issue Aug 7, 2024 · 4 comments
Closed

BUG - No css file generate #233

Braintheme opened this issue Aug 7, 2024 · 4 comments

Comments

@Braintheme
Copy link

The .css file don't generations

My code:

import svgtofont from 'svgtofont';
import path from 'node:path';

const srcPath = path.resolve(process.cwd(), 'assets/fonts/icons/src');
const distPath = path.resolve(process.cwd(), 'assets/fonts/icons/dist');

svgtofont({
  src: srcPath, // svg path
  dist: distPath, // output path
  fontName: 'pst-font', // font name
  css: true, // Create CSS files.
}).then(() => {
  console.log('done!');
}).catch((error) => {
  console.error('Error:', error);
});

Log:

SUCCESS SVG font successfully created!
  ╰┈▶ /Applications/MAMP/htdocs/presets-shop/wp-content/themes/presettheme/assets/fonts/icons/dist/svgtofont.svg
SUCCESS TTF font successfully created!
  ╰┈▶ /Applications/MAMP/htdocs/presets-shop/wp-content/themes/presettheme/assets/fonts/icons/dist/svgtofont.ttf
SUCCESS EOT font successfully created!
  ╰┈▶ /Applications/MAMP/htdocs/presets-shop/wp-content/themes/presettheme/assets/fonts/icons/dist/svgtofont.eot
SUCCESS WOFF font successfully created!
  ╰┈▶ /Applications/MAMP/htdocs/presets-shop/wp-content/themes/presettheme/assets/fonts/icons/dist/svgtofont.woff
SUCCESS WOFF2 font successfully created!
  ╰┈▶ /Applications/MAMP/htdocs/presets-shop/wp-content/themes/presettheme/assets/fonts/icons/dist/svgtofont.woff2
SUCCESS Svg Symbol font successfully created!

Node.js v18.16.0

@jaywcjlove
Copy link
Owner

image

@Braintheme I can't reproduce your error. Could you provide an example that reproduces the error?

jaywcjlove added a commit that referenced this issue Aug 8, 2024
github-actions bot pushed a commit that referenced this issue Aug 8, 2024
@Braintheme
Copy link
Author

I fixed it after update note to latest version

@wuzesen
Copy link

wuzesen commented Aug 21, 2024

我也是一样的代码,但是报错
import svgtofont from 'svgtofont';
import path from 'node:path';

svgtofont({
src: path.resolve(process.cwd(), './src/icons/svg'), // svg path
dist: path.resolve(process.cwd(), './src/icons/fonts'), // output path
fontName: 'pst-font', // font name
css: true, // Create CSS files.
}).then(() => {
console.log('done!');
});

SUCCESS SVG font successfully created! ╰┈▶ F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\src\icons\fonts\pst-font.svg SUCCESS TTF font successfully created! ╰┈▶ F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\src\icons\fonts\pst-font.ttf SUCCESS EOT font successfully created! ╰┈▶ F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\src\icons\fonts\pst-font.eot SUCCESS WOFF font successfully created! ╰┈▶ F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\src\icons\fonts\pst-font.woff SUCCESS WOFF2 font successfully created! ╰┈▶ F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\src\icons\fonts\pst-font.woff2 SUCCESS Svg Symbol font successfully created! ╰┈▶ F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\src\icons\fonts\pst-font.symbol.svg node:internal/validators:163 throw new ERR_INVALID_ARG_TYPE(name, 'string', value);

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined at new NodeError (node:internal/errors:399:5) at validateString (node:internal/validators:163:11) at Object.basename (node:path:752:5) at F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\node_modules@tsbb\copy-template-dir\index.js:59:28 at F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\node_modules\run-parallel\index.js:46:7 at Array.forEach () at runParallel (F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\node_modules\run-parallel\index.js:45:11) at ReaddirpStream. (F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\node_modules@tsbb\copy-template-dir\index.js:45:7) at ReaddirpStream.f (F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\node_modules\once\once.js:25:25) at ReaddirpStream.onend (F:\gitlab.vmic.xyz\vivoshop\nex-repeater-admin-vue\node_modules\end-of-stream\index.js:36:27) { code: 'ERR_INVALID_ARG_TYPE' }

Node.js v18.16.1

svgtofont版本是5.0.3

@jaywcjlove
Copy link
Owner

@wuzesen 我无法重现你的错误,如果你重建一个仓库,重现错误,我可以帮你排查看一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants