Skip to content

Go To Definition not working if import path has cache busting (javascript) #29232

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

Closed
webappslove opened this issue Jan 2, 2019 · 3 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@webappslove
Copy link

VSCode Version: 1.28 - 1.31
OS Version: Windows 10
Steps to Reproduce:
import a class with a suffix after .js:
import Rooms from './components/Rooms.js?2019.01.01'
Go to definition then just brings you to the import.

Does this issue occur when all extensions are disabled?: Yes

@mjbvz mjbvz transferred this issue from microsoft/vscode Jan 2, 2019
@mjbvz mjbvz removed their assignment Jan 2, 2019
@ajafff
Copy link
Contributor

ajafff commented Jan 2, 2019

Duplicate of #22689

@weswigham weswigham added the Duplicate An existing issue was already created label Jan 3, 2019
@webappslove
Copy link
Author

OK, I just want to leave a kind of workaround here in case someones find this specific issue : use a search and replace in files...

Easy to do when you only need to update the app version – and this is what I was doing before – but now we need to remove it for development, and re-add a version before deploy, and only for the wanted file extensions, excluding specific words (limit the scope of files searched with the dedicated include / exclude fields). The only limitation I found is that this will only match one file path per line, and only if the line doesn't include a forbidden word, so just use paths on their own lines.

Toggle the regex button and enter in the search field: (change your forbidden words and/or file extensions)
^(?!.*(?:firebase|http))(.*?\.(?:js|css))(?:(?![\w.-])(\?[\d\.]+\w)?)

Then in the replace field, enter either:

  • $1?YOUR_VERSION before deploying, or
  • $1 to remove the version for development with intellisense working!

Test modifications here: https://regexr.com/45s36

Now I would love to have search snippets! (for this one and also for search excluding comments) No idea how or what it would look like though... :)

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

5 participants