question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New v5 generate index.js feature does not account for filenames beginning with numerals

See original GitHub issue

🐛 Bug Report

The index.${ext} file that is now generated with v5 does not account for filenames beginning with numerals.

To Reproduce

Steps to reproduce the behavior:

  • create folder with a file named: 2circles.svg
  • run svgr cli command with --out-dir option
  • inspect created index.js file
  • output should be:
export { default as 2circles } from './2circles.svg'

Expected behavior

Since the componentName is generated from the .svg filename and prepends the Svg string to account for filenames with numerals, it would be expected for the generateIndex function to be consistent and instead return the following for the example above:

export { default as Svg2circles } from './2circles.svg';

envinfo

## System:
 - OS: Windows 10 10.0.16299
 - CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
 - Memory: 6.37 GB / 15.88 GB
## Binaries:
 - Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
 - npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gregbergecommented, Jan 17, 2020

@TrySound since SVG starting with a number does not actually work, it would not be a breaking change.

I am OK for adding Svg prefix to all Svg starting with a number. I will not fix it right now, feel free to submit a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

New v5 generate index.js feature does not account ... - GitHub
The index.${ext} file that is now generated with v5 does not account for filenames beginning with numerals. To Reproduce. Steps to reproduce the ......
Read more >
Index API | Elasticsearch Guide [8.5] | Elastic
You can index a new JSON document with the _doc or _create resource. Using _create guarantees that the document is only indexed if...
Read more >
Entry Points - webpack
Single Entry Syntax is a great choice when you are looking to quickly set up a webpack configuration for an application or tool...
Read more >
webpack Tutorial: How to Set Up webpack 5 From Scratch
For the most part, websites are no longer just written in plain HTML with a bit of ... I'll start by creating a...
Read more >
Error: Can't resolve 'core-js/es7/reflect' in '\node_modules ...
Removing the number at the end of 'es' in the path, like 'core-js ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found