primordic/IssueDupesLite huggingface dataset:
Repository: sigma67/ytmusicapi

Issue #497: Add remove_search_suggestion
Created: 2023-12-31T12:20:52Z
Is your feature request related to a problem? Please describe.
Followup to #494 -- user should be able to remove a search suggestion (as done in the Web UI via the trash bin icon)
Describe the solution you'd like

extend get_search_suggestions (with detailed runs arg) to return the feedbackTokens needed
implement a function remove_search_suggestion

Describe alternatives you've considered
none
Additional context
none

Duplicate issue #472: Get_search_suggestions KeyError: 'searchSuggestionRenderer'
Created: 2023-11-16T13:03:45Z
Describe the bug
Google seems to have added history type suggestions to the search suggestions (example below from the app) at some point. These are under a different key to regular search suggestions so the current implementation will fail if history exists (example below of the JSON structure).


Proposal:
get_search_suggestions revised to:

look at historySuggestionRenderer if searchSuggestionRenderers not in the list of contents.
return suggestion type as well as the suggestions themselves.

To Reproduce
Steps to reproduce the behavior:

Setup a new Oauth session
Run get_search_suggestions twice in a row (first time adds it to your history).
KeyError: 'searchSuggestionRenderer'

Additional notes
From the screenshot, seems there is also a way to delete search history suggestions, this could be a future enhancement

Closing comment (2024-01-06T19:53:37Z): was addressed in #495
the future enhancement to delete search suggestions is tracked in #497
Repository: sigma67/ytmusicapi

Issue #125: Atoi with base 10 1,224
Created: 2020-12-16T20:47:14Z
KoljaWindeler/ytube_music_player#22 (comment)
Basically an atoi issue
extra_info = self._api.get_playlist(playlistId=playlist['playlistId'])
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 91, in get_playlist
song_count = to_int(
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 71, in to_int
return locale.atoi(number)
File "/usr/local/lib/python3.8/locale.py", line 330, in atoi
return int(delocalize(string))
ValueError: invalid literal for int() with base 10: '1,224'
Ps: is this the best way to raise bugs or should i redirect them straight to this respository?

Duplicate issue #129: Error getting play list
Created: 2020-12-18T14:01:13Z
Just and FYI
2020-12-18 08:55:56 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player]
============= ytube_music_player Integration Error ================
2020-12-18 08:55:56 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] unfortunately we hit an error in the sub api, please open a ticket at
2020-12-18 08:55:56 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] https://github.com/sigma67/ytmusicapi/issues
2020-12-18 08:55:56 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] and paste the following output:
2020-12-18 08:55:56 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] Traceback (most recent call last):
File "/config/custom_components/ytube_music_player/media_player.py", line 484, in _load_playlist
my_radio = self._api.get_playlist(playlistId = self._playlists[idx]['playlistId'], limit = int(self._playlists[idx]['count']))['tracks']
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 91, in get_playlist
song_count = to_int(
File "/usr/local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 71, in to_int
return locale.atoi(number)
File "/usr/local/lib/python3.8/locale.py", line 330, in atoi
return int(delocalize(string))
ValueError: invalid literal for int() with base 10: '2,828'
2020-12-18 08:55:56 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player]
thanks, Kolja
2020-12-18 08:55:56 ERROR (SyncWorker_5) [custom_components.ytube_music_player.media_player] ============= ytube_music_player Integration Error ================

Closing comment (2020-12-18T14:06:15Z): This seems to be a duplicate of #125? Please close if it is
Repository: sigma67/ytmusicapi

Issue #223: Replace usage of pkg_resources with importlib_resources 
Created: 2021-08-22T19:27:42Z
Replace pkg_resources with importlib_resources as  ytmusicapi's usage is limited to the scope of importlib_resources's, and pkg_resources have issues related to python 3.9 with LegacyVersion being deprecated and defaulting to this as mentioned in:

pypa/packaging#368
pypa/setuptools#2497
pypa/setuptools#2466
pypa/setuptools#2497
pypa/packaging#407

While the issue has been known for a while, fixes are not merged yet.
Motivation for this issue: AppDaemon/appdaemon#1336

Duplicate issue #250:  File "ytmusicapi\ytmusic.py", line 102, in __init__ not found
Created: 2022-01-03T19:42:21Z
HI, I've used your wonderful api to create a player. The api works absolutely flawlessly, however when I tried to create an executable using pyinstaller and upon completion of the pyinstaller, when I run the exe file I get the following message:
`
Failed to execute script 'main' due to unhandled exception: [WinError3] The system cannot find the path specified: 'C:\Users\User\AppData\Local\Temp\_MEI39042\ytmusicapi\locales'
Traceback (most recent call last):
File "main.py", line 10, in 
File "ytmusicapi\ytmusic.py", line 102, in init
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\User\AppData\Local\Temp\_MEI39042\ytmusicapi\locales'
`
Any ideas on why would that happen or where can I get the installed files? Thanks a lot in advance!

Closing comment (2022-01-04T13:17:10Z): I've never used pyinstaller, but I think you need to tell it to also include the package data of the dependency. ytmusicapi can't find the locales directory needed for localization, which it expects to be in the path specified in your error.
Perhaps this is also related to #223, you may try using resource_listdir like here in your fork of ytmusicapi
Repository: sigma67/ytmusicapi

Issue #392: Albums And Singles Not Available On Artist Page
Created: 2023-05-09T22:52:39Z
Describe the bug
An update to youtube music has nested the albums and singles in a "Top Releases" row with a "see more" click through.
To Reproduce
Steps to reproduce the behavior:

Go to any artist page (ex. https://music.youtube.com/channel/UCeKDV9JgivrXehVluw5bKFA)
See "Top Releases" where "Albums" used to be.
Click on "Top Releases" or "See More" and see the buttons to switch to "Albums" there

Additional context
Calling the "get_artist" function returns the Songs, Videos, and Related sections but not the "Top Releases"

Duplicate issue #393: get_artist() not always getting albums & singles
Created: 2023-05-13T11:12:32Z
Describe the bug
Sometimes, for some reason, when I try to get_artist(), it will return a dictionary without "albums"
and "singles" and then I end up getting KeyError: "albums" or "singles" when I try to access them.
To Reproduce
Steps to reproduce the behavior:

get artistID with .search(query, "artists", limit=1)[0]["browseId"]
get artist with .get_artist(artistID)
try to access artist["albums"] or artist["singles"]

Additional context
Also, I don't think limit in search() works, since it returns more than 1 artist
get_artist() dictionary
Without KeyError

With KeyError

Closing comment (2023-05-13T13:43:55Z): Likely related to #392
Please check if you have "Top Releases" when going to an artist's page, if yes this issue is a duplicate. Check here: https://music.youtube.com/channel/UClmXPfaYhXOYsNn_QUyheWQ
Regarding limit: https://ytmusicapi.readthedocs.io/en/stable/faq.html#why-is-ytmusicapi-returning-more-results-than-requested-with-the-limit-parameter
Repository: simplecov-ruby/simplecov

Issue #270: Safari rendering issues
Created: 2013-12-21T05:14:14Z
Having issues when viewing coverage results in Safari. This does not occur in Chrome or Firefox. This issue did not exist in older versions. Hope that helps with isolating what change.

Duplicate issue #307: Coverage reports broken
Created: 2014-05-31T08:51:42Z
In the newest version of simplecov when clicking on a file name, the popup box that should contain the source code is broken, see images. simplecov version 0.7.1 works just fine. I also get some error messages in the debug console about images missing:
[Error] Failed to load resource: The requested URL was not found on this server. (ui-bg_highlight-soft_75_cccccc_1x100.png, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (ui-bg_glass_75_e6e6e6_1x400.png, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (ui-icons_888888_256x240.png, line 0)

This is in Safari 7.0.3.

Closing comment (2014-06-04T12:18:00Z): Hi guys, just noticed this is a duplicate of #270 and simplecov-ruby/simplecov-html#27, I'll close this so we have a streamlined place to track this problem over at #270.
Repository: simplecov-ruby/simplecov

Issue #281: Rspec 2.14 + Ruby 2.1.0 + Simplecov 0.8.x doesn't pass along the correct exit status
Created: 2014-01-22T21:25:10Z
Looks like Simplecov 0.8.x, Ruby 2.1.0, and Rspec 2.14 don't quite work together as you would expect. When running bundle exec rspec in that environment (with Rails 4.0.2), the exit code when tests fail is 0, when it should be 1. However, when I run them on Ruby 2.0.0(-p353) with Simplecov 0.8.x, it correctly exits 1. Even weirder, when running them on Ruby 2.1.0 and Simplecov 0.7.1, it also correctly exits 1.

Duplicate issue #269: SimpleCov affecting exit code of bacon
Created: 2013-12-20T18:41:44Z
SimpleCov causes bacon to exit with a zero exit code even in case of failures/errors. The issue affects CI as failures are simply not reported and can go undetected.
The issue is present at least since version 0.8.1, but something more subtle might be going on.

As code speaks louder than words consider the following example:

The build succeeds even with a failure
SimpleCov is downgraded without any other chage
The downgrade fixes an artificial  issue created on purpose locally (locally I'm using Ruby 2.0.0) but not this specific one on Travis (this might be an error on my part or interference from the coveralls gem)
SimpleCov is removed
The build fails correctly

Closing comment (2014-02-12T10:39:34Z): Simply reverting that particular change did not help :( This issue is very likely the same as #281, and although that one came later, there is more activity over there, so I'll close this in favor of the other one. Please go on with the discussion there :)
Repository: simplecov-ruby/simplecov

Issue #468: Buggy state of 0.11.x
Created: 2016-03-06T20:59:01Z
I don't mean to be pushy or ungrateful for this great-gem-I-cant-live-without, but may I ask what is the state of the 0.11.x release?
It seems like something went a little sideways in all 0.11.x releases - I have been unable to upgrade to any of them, I am still stuck at 0.10 due to several issues - namely #467 , #454 , #443 and similar.
Normally, I wouldn't mind staying a little behind until things stabilize, but 0.10 is giving me some other issues I would like to get rid of already. For example, lack of coverage of concern files as mentioned in #167, and just now, a new issue, where the comment # :nocov: is considered "not covered" and drops my coverage rate... hows that for irony... 😉

Duplicate issue #527: lines with the skip_token are counted as not covered
Created: 2016-10-13T01:38:44Z
Lines that are marked with the skip_token such as nocov are being counted as not covered. In the screenshot below, I attempted to declare that an entire file should not be covered, but after annotating it it shows 2 lines not covered, which are the 2 that have the skip_token on them.

per CONTRIBUTING.md:

I am using simplecov v0.12.0
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
rails (5.0.0.1)
no other coverage gems
using rspec-rails (3.5.2)

please let me know if more info is needed to debug

Closing comment (2016-10-13T01:44:53Z): seems very similar to #468
Repository: simplecov-ruby/simplecov

Issue #600: track_files option counts every line as relevant
Created: 2017-07-24T14:30:49Z
Hi!
It seems that files that are attached using track_files option are not analyzed for contents and relevant_lines count for those files is equal to lines count. This shouldn't bring any harm by itself, but in my case i have three accumulating test runs that upload their results to Coveralls - and because of that, at the end of the third run Coveralls thinks that i have 500 relevant lines more than i actually have and gives me 60% (while it is around 95% in reality).
I think i'll manage to create a fix on my side (by running Coveralls tool by hand)< but it would be wonderful if SimpleCov would provide such feature out-of-the-box.

Duplicate issue #604: Relevant lines incorrect for unloaded files?
Created: 2017-08-09T13:38:01Z
Working on a legacy codebase with no-previous tests, I noticed that unloaded files don't have relevant lines classified correctly. Whitespace and comments are classified as relevant, thereby overstating the total number of uncovered lines for the codebase.
I've made a repo to reproduce the issue.
Actual result:

Expected result:

Source of issue
I believe this issue is caused by SimpleCov#add_not_loaded_files:
def add_not_loaded_files(result)
  if tracked_files
    result = result.dup
    Dir[tracked_files].each do |file|
      absolute = File.expand_path(file)

      result[absolute] ||= [0] * File.foreach(absolute).count
    end
  end

  result
end
This always creates an array of zeros, but for whitespace / comment lines this should be nil to satisfy the downstream SourceFile::Line code:

the coverage being either nil (coverage not applicable, e.g. comment line), 0 (line not covered) or >1 (the amount of times the line was executed

I'm happy to make a PR with a fix for this but would appreciate confirmation this issue is valid.

Closing comment (2017-08-09T13:46:31Z): Just realised this is probably related to #600
Repository: simplecov-ruby/simplecov

Issue #42: Spork doesn't seem to run SimpleCov correctly with RSpec and Rails
Created: 2011-05-06T13:11:32Z
tl;dr:
Summary of results:

summary of issuesSpork
not runningrunning
SimpleCovtop of Spork.preforkworks as expectedSimpleCov doesn't run
top of Spork.each_runalways 0 LOC, 0% coverageSimpleCov doesn't run


I'm on an existing Rails project using Mongoid, Devise, RSpec, and Spork (0.9.0.rc5). Our spec/spec_helper.rb looks like this:
require 'spork'

ENV["RAILS_ENV"] ||= 'test'

Spork.prefork do
  require 'simplecov'
  SimpleCov.start 'rails'

  # trap mongoid
  require 'rails/mongoid'
  Spork.trap_class_method(Rails::Mongoid, :load_models)

  # trap devise
  require 'rails/application'
  Spork.trap_method(Rails::Application, :reload_routes!)

  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
  Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}

  DatabaseCleaner.strategy = :truncation

  RSpec.configure do |config|
    config.mock_with :rspec

    config.before(:each) do
      DatabaseCleaner.clean
    end
  end
end

Spork.each_run do
  # reload factories
  Factory.definition_file_paths = [
    File.join(Rails.root, 'spec', 'factories')
  ]
  Factory.find_definitions
end
This configuration will run SimpleCov when Spork is not running, and it produces the expected result. When Spork is running, no coverage message is shown.
If I move the require 'simplecov'; SimpleCov.start 'rails' lines to the beginning of the Spork.each_run block, as SimpleCov's readme suggests, then when Spork is not running, I get this:
Coverage report generated for RSpec to /home/johnf/projects/<elided>/coverage. 0 / 0 LOC (0.0%) covered.

If Spork is running, then instead I get no coverage message, as before.

Duplicate issue #182: no coverage data for at least one model
Created: 2012-12-10T20:38:19Z
I have about a dozen or so models in my Ruby on Rails app and the user model is not getting any coverage. I know that code in the user.rb is running and I even have several explicit tests against the model itself. I'm not sure where to begin to troubleshoot this, any advice?

Closing comment (2013-10-21T12:41:13Z): have since found that this issue is same as #42
Repository: simplecov-ruby/simplecov

Issue #362: Fix order dependencies in unit tests
Created: 2015-01-23T04:44:07Z
After switching from Test::Unit to Minitest, I started noticing some intermittent build failures. These will typically self-correct by restarting the build. They seem to be caused by an order dependency.
Minitest will force the tests to run in alphabetical order if you add the flag i_suck_and_my_tests_are_order_dependent! but I think it would be better to just fix the order dependency. 😊
There’s a project called minitest-bisect that should make it easier to track down random failures.

Duplicate issue #372: Fix the build
Created: 2015-02-18T14:47:15Z
We are getting a bunch of seemingly random failures, on different ruby versions when building on travis.
Locally everything works fine for me and the failing ruby versions vary across builds.
https://travis-ci.org/colszowka/simplecov/builds

Closing comment (2015-02-19T03:40:08Z): Duplicate of #362
Repository: simplecov-ruby/simplecov

Issue #16: Files with no coverage
Created: 2010-11-15T17:23:47Z
Files without any coverage are not shown at all. It is important for me to be able to view these files.
As this is not detected by the built-in Coverage module, perhaps an option could be added to search for files in the current folder?
I'll try to create a proof-of-concept for this.

Duplicate issue #291: Untouched files not listed
Created: 2014-03-26T09:07:35Z
Hi, I'm using simplecov with rails 4.1 rc, ruby 2.1.1, simplecov 0.8.2, when running the full rspec suite with rspec I get included in the coverage report only the files touched by any of the tests, files never touched aren't included so my coverage percentage is wrong, is this the expected behaviour?

Closing comment (2014-03-26T10:02:45Z): Duplicate of #16
Repository: simplecov-ruby/simplecov

Issue #60: Covered code shown as skipped
Created: 2011-07-13T09:42:11Z
I'm using ruby 1.9.2-p180, simplecov gem 0.4.2.
Though, i've written test for my model methods, simple coverage html file shows all of them as missed lines. This has happened only in few of my models and not all.

Duplicate issue #80: not working with riot correctly?
Created: 2011-09-18T22:18:11Z
simplecov results: http://stuff.saikonet.org/images/misc/2011-09-18-150129_1024x768_scrot.png
my tests:
context 'New user visits web site' do
    base_uri 'http://localhost:3001'
    get '/'
    asserts_status.equals(200)
end
context 'Authentication' do
    context 'User signs up' do
      base_uri 'http://localhost:3001'
      post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'my_pass' } }
      asserts_status.equals(200)
      asserts('display tasks') { response.body.match(/New Task/) != nil }
    end

    context 'User signs in' do
       base_uri 'http://localhost:3001'
       post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'my_pass' } }
       asserts_status.equals(200)
       asserts('display tasks') { response.body.match(/New Task/) != nil }
     end
    context 'User tries to signup with existing email' do
       base_uri 'http://localhost:3001'
       post '/site/authenticate', body: { user: { email: 'saiko_chriskun@shortmail.com', password: 'incorrect_pass' } }
       asserts_status.equals(200)
       asserts('display flash message') { response.body.match(/taken!/) != nil }
     end
end

Closing comment (2012-02-13T06:38:46Z): I'm not having any trouble using it with Riot...  Although, I was.
I'm trying to remember how I fixed it.  I think what I actually ended up with was this: https://gist.github.com/1814276
Again, I'm fuzzy on the whole "fix".  But I think it's the rand(99999) part that is the key.  Somehow it allows the results to accumulate, otherwise each set of tests overwrites the previous set of results.  Using a random name prevents the overwriting.  (Well it actually just makes the odds 1:99999.)  What you're probably encountering is your model tests being run after your controller tests, so the controller test coverage results get overwritten.
And yeah I'm pretty sure it's related to #60
Repository: simplecov-ruby/simplecov

Issue #433: Comment lines in unloaded files are marked as uncovered
Created: 2015-12-02T23:58:42Z
In version 0.10, the additional lines on mult-iline statements, as well as comments, were ignored -- which seems like the correct behaviour.  In version 0.11, these lines are marked as not covered.
Before and after:

Duplicate issue #440: Decreased coverage with version 0.11
Created: 2015-12-11T09:44:36Z
Hi,
Not sure if this is the same issue as #433 or not.
After updating the gem from 0.10 to the latest 0.11.1 my code coverage dropped from 100% to 73%
The reasons as I could see are:

Files that were not considered in the coverage before we suddenly considered, and have 0% coverage.
Empty lines and comments are now considered

Here is a small screenshot of a file that should have 100% coverage

For now, I have locked simplecov at 0.10 in the Gemfile as a workaround.
Let me know if you need more details.

Closing comment (2015-12-11T16:38:55Z): Thanks for the report!
First issue is expected per #422 ... occurs to me that we listed the feature in the changelog but not the defaults change for Rails. I just added this.
Second issue is a dup of #433 and should be fixed on master, though this needs confirmation before I'll release it. (There is also a work around on that ticket.)
Repository: simplecov-ruby/simplecov

Issue #781: Release Branch coverage
Created: 2019-12-05T11:54:56Z
After merging #694 this issue is here to keep track of the functionality until initial release and helps me & others :)
Big thanks to @som4ik @tycooon @stepozer @klyonrad and many others for their valuable contributions!

 Merge initial PR #694
 Merge corresponding html formatter PR simplecov-ruby/simplecov-html#64

 Address remaining code review feedback


 Make sure problems with existing PR are solved (ref1 ref2)

 parallel tests support works as intended
 :nocov: blocks should be considered


 Address initial code review comments
 Change used option name to use branch coverage/chanege coverage type
 add some feature tests

 for instance with the neat tester script


 Investigate coverage reporting (it seems like it reports lines as covered when what we'd like to have are branches)
 release pre release version for general/public testing (this and formatter)
 make it possible that the branch coverage percentage is displayed as the "main" coverage and all our checks take it instead of line coverage
 also allow people to do coverage checks versus multiple metrics for instance I want my line coverage to be at least 95% and my branch coverage to be at least 90%.
 figure out problems with the format data is stored in #781
 fix reported beta problems
 release the "finished for now" branch coverage

Duplicate issue #412: Branch Coverage Metrics? (Ruby 2.5 is here!)
Created: 2015-08-22T19:35:03Z
Is there any way to collect branch coverage metrics additional to statement/line coverage?

Closing comment (2019-12-05T11:56:02Z): Thanks to lots of people a basic version just landed on master. Remaining work for a full release is tracked in #781
Repository: sindresorhus/file-type

Issue #541: Unable to get file-type to run in browser (modules strtok3/core and token-types not found)
Created: 2022-04-25T18:31:11Z
We are using
Angular 11.2.9,
Chrome Version 100.0.4896.127 (Official Build) (64-bit) ,
file-type version 17.1.1,
webpack version 4.44.2.
we have used solution from 502 to solve node:buffer error to run the library in browser.
After doing above, we are getting below mentioned errors.
Error: ./node_modules/file-type/core.js
Module not found: Error: Can't resolve 'strtok3/core' in '/home/demo/node_modules/file-type'

Error: ./node_modules/file-type/core.js
Module not found: Error: Can't resolve 'token-types' in '/home/demo/node_modules/file-type'

Are there any instructions available for getting this package to work in angular version 11.2.9 ?

Duplicate issue #539: Cannot find module 'strtok3/core'
Created: 2022-04-19T12:17:21Z
Hi,
i have found this related closed merge Request #513 but i have this error still in the latest version.
Unfortunately, you won't get any more answers to questions in this thread. When is it possible to release the next version where this problem is fixed?

Closing comment (2022-05-27T09:27:50Z): Duplicate of #541
Repository: sindresorhus/file-type

Issue #661: ERR_PACKAGE_PATH_NOT_EXPORTED when file-type used in nest.js
Created: 2024-08-22T13:55:02Z
Hi,
I'm using file-type in nest.js and I've this error, using the last 19.4.1 version.
nest start
node:internal/modules/cjs/loader:597
      throw e;
      ^

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in D:\dev\olhos\nest-test\node_modules\file-type\package.json
    at exportsNotFound (node:internal/modules/esm/resolve:304:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:594:13)
    at resolveExports (node:internal/modules/cjs/loader:590:36)
    at Module._findPath (node:internal/modules/cjs/loader:667:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1129:27)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (D:\dev\olhos\nest-test\src\app.controller.ts:3:1)
    at Module._compile (node:internal/modules/cjs/loader:1369:14) {
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}

To simply reproduce the problem:
npm i -g @nestjs/cli
nest new nest-test
cd nest-test
npm i file-type

Edit the sample controller, scaffolded from nest.js:
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
import { fileTypeFromFile } from 'file-type';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  async getHello(): Promise<string> {
    return (await fileTypeFromFile('Unicorn.png')).mime;
  }
}

nest start
Any idea?
Thanks

Duplicate issue #666: No "exports" main defined
Created: 2024-08-29T07:44:08Z

Closing comment (2024-08-29T11:26:13Z): Similar to #661.
Please note, as clearly stated in the README, this is an ESM module, you need to import it as such.
Repository: sindresorhus/file-type

Issue #54: Detect .docx 
Created: 2016-02-19T08:47:34Z
Is there any possibility to detect OfficeOpenXML files out/separated from "application/zip". Now its detected :
► iMac@test:node  test85.js
file: ./testitiedosto.docx, filetype: { ext: 'zip', mime: 'application/zip' }

but I do not want to allow all zip-files; only .docx and maybe .xmlx. Any workarounds for that?
I know there might be other modules, but I want to keep my stack as lean as possible.

Duplicate issue #66: Docx files
Created: 2016-11-15T10:55:24Z
All docx files are returned as application/zip instead of application/msword.

Closing comment (2016-11-15T12:01:14Z): Duplicate of #54.
Repository: sindresorhus/file-type

Issue #525: I can't load through commonjs in Node
Created: 2022-01-14T04:56:31Z
I tried a number of ways to require it but to no avail, I literally can't use file-type on Node because of this. It looks like you just need to remove the module prop from the package.json.
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/.../node_modules/file-type/index.js ... Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/.../node_modules/file-type/package.json.

Duplicate issue #538: Error when trying to import/use in svelte/rollup project.
Created: 2022-03-16T00:05:45Z
When I import it how the doc suggests.
import { fileTypeFromBuffer } from "file-type";
I get:
[!] (plugin svelte) Error: No such built-in module: node:buffer/package.json
Error: No such built-in module: node:buffer/package.json
    at new NodeError (node:internal/errors:372:5)
    at Function.Module._load (node:internal/modules/cjs/loader:785:13)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.resolveId (/home/iohzrd/src/identia/node_modules/rollup-plugin-svelte/index.js:67:11)
    at /home/iohzrd/src/identia/node_modules/rollup/dist/shared/rollup.js:22779:37

I've also tried importing it like so:
import { fileTypeFromBuffer } from "file-type/index";
As is often necessary in svelte.
But then I get:
(!) Unresolved dependencies
https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency
file-type/index (imported by src/components/Post.svelte)
(!) Missing global variable name
Use output.globals to specify browser global variable names corresponding to external modules
file-type/index (guessing 'index$5')

I tried various solutions related to external dependencies but still couldn't get it to work.
Keep in mind that the code works otherwise.
Anyone have any insights?

Closing comment (2022-03-16T05:45:13Z): Duplicate of #525
Repository: sindresorhus/file-type

Issue #99: Many MP4 variants are not implemented
Created: 2017-08-15T11:44:28Z
https://github.com/file/file/blob/master/magic/Magdir/animation
We should either implement these or finish #68


stroncium earned $80.00 by resolving this issue!

Checkout the Issuehunt explorer to discover more funded issues.
Need some help from other developers? Add your repositories on Issuehunt to raise funds.

Duplicate issue #122: m4a from android phone
Created: 2018-01-23T14:39:30Z
I have used the audio recorder on my android phone to record a m4a-file. When i run it through the filetype-function it returns null (it cant find a match).
The Uint8Array for my m4a-file starts with:
0, 0, 0, 24, 102, 116, 121, 112, 51, 103, 112, 52, 0, 0, 0, 0
In the the filetype-function m4a-check:
check([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4}) ||
check([0x4D, 0x34, 0x41, 0x20])
Is it something special with the m4a file I get from the phone recorder or should this be updated?

Closing comment (2018-02-11T16:07:47Z): this could be related to #99
Repository: sindresorhus/file-type

Issue #70: Arrow functions are not compatible with UglifyJS or IE11
Created: 2016-12-22T16:54:50Z
The latest 4.0.0 release uses arrow functions but that is not quite ready for prime time.
http://caniuse.com/#feat=arrow-functions
Also, UglifyJS does not support arrow functions.
We bundle our javascript with Webpack and use UglifyJS to minify our final bundle. The 4.0 release breaks because of the arrow functions.
Progress is good and tolling support for arrow function will get more and more widespread, but I suggest may be adding a warning on the 4.0 release / branch that some users might prefer to stay on the 3.x branch?

Duplicate issue #97: Syntax is current version not compatible with IE 11
Created: 2017-08-04T18:52:16Z
Would you be open to a PR that adds prepublish tooling targeting active browsers?

Closing comment (2017-08-04T19:00:53Z): Duplicate of #70
Repository: sindresorhus/file-type

Issue #525: I can't load through commonjs in Node
Created: 2022-01-14T04:56:31Z
I tried a number of ways to require it but to no avail, I literally can't use file-type on Node because of this. It looks like you just need to remove the module prop from the package.json.
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/.../node_modules/file-type/index.js ... Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/.../node_modules/file-type/package.json.

Duplicate issue #533: node 12 fresh install unexpected token
Created: 2022-03-08T19:31:23Z
fresh install on node v12.8.1 give me this error
import * as strtok3 from 'strtok3';
^
SyntaxError: Unexpected token *
at Module._compile (internal/modules/cjs/loader.js:811:22)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
at Module.load (internal/modules/cjs/loader.js:731:32)
at Function.Module._load (internal/modules/cjs/loader.js:644:12)
at Module.require (internal/modules/cjs/loader.js:771:19)
at require (internal/modules/cjs/helpers.js:68:18)
I only import the library like this
import { fileTypeFromStream } from 'file-type';
and using like this
const readStream = fs.createReadStream(path);
const fileType = await fileTypeFromStream(readStream);

Closing comment (2022-03-09T19:42:03Z): Same as #525
Repository: sindresorhus/file-type

Issue #70: Arrow functions are not compatible with UglifyJS or IE11
Created: 2016-12-22T16:54:50Z
The latest 4.0.0 release uses arrow functions but that is not quite ready for prime time.
http://caniuse.com/#feat=arrow-functions
Also, UglifyJS does not support arrow functions.
We bundle our javascript with Webpack and use UglifyJS to minify our final bundle. The 4.0 release breaks because of the arrow functions.
Progress is good and tolling support for arrow function will get more and more widespread, but I suggest may be adding a warning on the 4.0 release / branch that some users might prefer to stay on the 3.x branch?

Duplicate issue #235: SyntaxError: Unexpected token ...
Created: 2019-08-23T03:44:10Z
/home/developing/tifu/tifu.beta/node_modules/file-type/index.js:29
                        ...options
                        ^^^

Closing comment (2019-08-23T09:23:27Z): Duplicate of #70
Repository: sindresorhus/file-type

Issue #525: I can't load through commonjs in Node
Created: 2022-01-14T04:56:31Z
I tried a number of ways to require it but to no avail, I literally can't use file-type on Node because of this. It looks like you just need to remove the module prop from the package.json.
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/.../node_modules/file-type/index.js ... Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/.../node_modules/file-type/package.json.

Duplicate issue #534: Babel transpilation error
Created: 2022-03-09T19:00:50Z
Importing fileTypeFromBuffer using babel transpiler with Node v16.13.1 throws an error, am I doing something wrong? (I also tried using dynamic import and give the same error)
Error message: Instead change the require of index.js in $FILE_PATH to a dynamic import() which is available in all CommonJS modules
file-type version: 17.1.1
babel deps:
 "@babel/cli": "^7.14.8",
 "@babel/core": "^7.15.0",
 "@babel/eslint-parser": "^7.15.0",
 "@babel/eslint-plugin": "^7.14.5",
 "@babel/node": "^7.14.9",
 "@babel/plugin-transform-modules-commonjs": "^7.15.4",
 "@babel/preset-env": "^7.15.0",

babel.rc:
{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "current"
        }
      }
    ]
  ],
  "plugins": [
    [
      "@babel/plugin-transform-modules-commonjs",
      {
        "allowTopLevelThis": true,
        "loose": true,
        "lazy": true
      }
    ]
  ]
}

file-type v16.5.3 works without issues

Closing comment (2022-03-09T19:41:23Z): Same as #525
Repository: sindresorhus/notifier-for-github

Issue #216: Add drop-down menu listing recent notifications
Created: 2020-06-19T14:29:23Z
For example, this discourse plugin has it: https://meta.discourse.org/t/google-chrome-extension-for-discourse-notifications/34496

Duplicate issue #226: Icon left click popop
Created: 2020-07-30T07:40:08Z
Maybe optionally, when I click on icon and unread notifications count > 0, display list of unread notifications (clickable) in popup without opening separate tab for all notifications?
And I can click on any unread notification in this popup to go to it directly.
And in top of this popup you can place link "Notifications on Github".
Something like this:

Closing comment (2020-07-30T16:17:53Z): Duplicate of #216
Repository: sindresorhus/notifier-for-github

Issue #11: Need a way to set update frequency and/or check updates manually
Created: 2014-11-05T11:43:00Z
Otherwise it feels too unresponsive.

Duplicate issue #17: Shorter Intervals
Created: 2015-04-16T06:35:59Z
The chrome extension works great and I use it every day. Though, there is one thing I would like to update. The notification fetching interval. Sometime it can take quite a long to update the little notification badge on the icon. Maybe we could add it to the settings page? Then everyone could specify their own preferences. What do you think?

Closing comment (2015-04-16T07:12:30Z): Duplicate of #11
Repository: sindresorhus/notifier-for-github

Issue #195: Add ability to change refresh rate
Created: 2019-10-16T17:46:54Z
Some people might want the notifications to update more or less frequently. Currently this is not possible.

Duplicate issue #217: Option to change poll frequency
Created: 2020-06-20T19:04:37Z
Is there a way I can change how often the extension polls github for notifications?

Closing comment (2020-06-21T05:39:04Z): Duplicate of #195
Repository: sindresorhus/notifier-for-github

Issue #132: Notifier stays offline despite regaining connection
Created: 2017-06-08T15:46:45Z
When Chrome goes offline and the extension looses connection to Github, it shows a yellow text bubble saying off (or something similar). When you regain internet connection, this bubble stays in place and the only way to reconnect is to manually click on the plugin icon. I have had the plugin be in 'offline' mode for long periods of time and therefore missed notifications.
Ideally, the plugin would re-connect itself and not require the user to click on the plugin icon to reconnect to Github. Not very familiar with the Chrome API but if it does not expose a method to be notified upon regaining internet connection, something like a setTimeout that pings the URL every 5 seconds until a connection could be another solution.
@sindresorhus Any thoughts? I will create a PR if you will accept it.




IssueHunt Summary

Backers (Total: $40.00)

 issuehunt ($40.00)

Submitted pull Requests

#196 Fix offline badges even when network is already online


Become a backer now!
Or submit a pull request to get the deposits!
Tips

Checkout the Issuehunt explorer to discover more funded issues.
Need some help from other developers? Add your repositories on IssueHunt to raise funds.


IssueHunt has been backed by the following sponsors. Become a sponsor

Duplicate issue #138: Stopped working on network changes or after connecting to VPN
Created: 2017-12-09T20:27:56Z
The extension icon turns to "off" state continuously after successfully connecting to a VPN server.

Closing comment (2018-06-29T17:32:28Z): Duplicate of #132.
Repository: sindresorhus/notifier-for-github

Issue #55: Extension occasionally uses regular tabs instead of existing notification tab
Created: 2016-01-20T18:30:55Z
Since the extension uses an existing notification tab to display, not always this tab but a regular tab (i.e. google.com) is being used.
Still having some difficulties narrowing this down any further, but it might have something to do with already opened GitHub tabs. (i.e. github.com/sindresorhus)
It might have something to do if a regular tab has been used as a notifications tab in the past.

Duplicate issue #56: Extension always opens in first tab
Created: 2016-01-22T19:25:06Z
I am using Chrome for Linux on the dev channel (Version 49.0.2623.13 dev (64-bit)) and the extension now always opens in the first tab.

Closing comment (2016-02-01T06:49:08Z): Duplicate of #55 (comment) ?
Repository: sindresorhus/notifier-for-github

Issue #132: Notifier stays offline despite regaining connection
Created: 2017-06-08T15:46:45Z
When Chrome goes offline and the extension looses connection to Github, it shows a yellow text bubble saying off (or something similar). When you regain internet connection, this bubble stays in place and the only way to reconnect is to manually click on the plugin icon. I have had the plugin be in 'offline' mode for long periods of time and therefore missed notifications.
Ideally, the plugin would re-connect itself and not require the user to click on the plugin icon to reconnect to Github. Not very familiar with the Chrome API but if it does not expose a method to be notified upon regaining internet connection, something like a setTimeout that pings the URL every 5 seconds until a connection could be another solution.
@sindresorhus Any thoughts? I will create a PR if you will accept it.




IssueHunt Summary

Backers (Total: $40.00)

 issuehunt ($40.00)

Submitted pull Requests

#196 Fix offline badges even when network is already online


Become a backer now!
Or submit a pull request to get the deposits!
Tips

Checkout the Issuehunt explorer to discover more funded issues.
Need some help from other developers? Add your repositories on IssueHunt to raise funds.


IssueHunt has been backed by the following sponsors. Become a sponsor

Duplicate issue #134: Does only show them when clicked once
Created: 2017-10-01T15:57:30Z
I recently got an issue that the addon does not show the badges anymore until i click on it.. After that it fetches the count just fine, until i restart the browser. I am using Opera, and installed it via https://addons.opera.com/de/extensions/details/download-chrome-extension-9/?display=en

Closing comment (2018-06-29T17:35:02Z): Duplicate of #132.
Repository: sindresorhus/notifier-for-github

Issue #244: New GitHub tokens are not accepted by the options form
Created: 2021-03-04T18:50:12Z
Not a bug yet, but soon it will be:
https://github.blog/changelog/2021-03-04-authentication-token-format-updates/
The new format isn't accepted by our form

Duplicate issue #247: Support for new token format
Created: 2021-04-05T23:25:44Z
For more information please see: Authentication token format updates

Closing comment (2021-04-06T08:47:55Z): Duplicate of #244
Repository: sindresorhus/notifier-for-github

Issue #155: Last update seems faulty
Created: 2018-07-25T12:00:48Z
Hi. With google-chrome-beta, the last update (18.7.25.917) seems kinda faulty:

The icon is now generic bell, instead of github-like icon.
Clicking on it no longer does anything. It used to open github
Desktop notifications no longer appear to function.

I tried removing it and re-installing, to to avail.

Duplicate issue #157: Latest update broke the extension pretty bad.
Created: 2018-07-25T17:47:49Z
It seems that you didn't update your browser-polyfill or whatever, because you used one too many arguments in the contains() function call. Clicking on the extension icon doesn't open the Github notification page, and I can't turn on desktop notifications on Chrome.

Closing comment (2018-07-25T18:36:44Z): Duplicate of #155
Repository: sindresorhus/notifier-for-github

Issue #60: Wrong tab choice
Created: 2016-03-04T14:56:29Z
Hey!
I got a little issue since few days with Notifier for GitHub on Chrome: when I click on the extension button, my Feedly tab  is focused and moved to GitHub notification, instead of a new fresh tab.

Tested:

No other extension
Chrome restarted
Feedly tab refresh
Feddly tab closed

Then the Trello tab , in fact the second tab, suffer the bug


Starting with Feedly tab focused

Then the Trello tab , in fact the next tab, suffer the bug


GitHub Notifications page opened in a new tab

Here everything is OK.



Do you have any idea of why? Thanks!
Chrome 49.0.2623.75 m (64-bit)

Duplicate issue #55: Extension occasionally uses regular tabs instead of existing notification tab
Created: 2016-01-20T18:30:55Z
Since the extension uses an existing notification tab to display, not always this tab but a regular tab (i.e. google.com) is being used.
Still having some difficulties narrowing this down any further, but it might have something to do with already opened GitHub tabs. (i.e. github.com/sindresorhus)
It might have something to do if a regular tab has been used as a notifications tab in the past.

Closing comment (2016-03-10T17:03:18Z): Duplicate of #60.
Repository: sindresorhus/notifier-for-github

Issue #95: Support github.com and github enterprise at the same time
Created: 2016-08-03T06:34:34Z
Please support github.com and github enterprise at the same time.

Duplicate issue #73: Multiple Sources for notifications
Created: 2016-03-29T18:06:48Z
Hi, Great extensions!   Just found it and I'm trying it out.   Does it support multiple notification sources such as being able to query the public notification api's as well as a private github enterprise environment at the same time?  Trying to figure out how to make it do that.

Closing comment (2019-06-14T07:43:09Z): Duplicate of #95
Repository: sindresorhus/pure

Issue #228: Single line prompt? 
Created: 2016-08-31T21:42:44Z
Thanks for pure prompt, I'm loving it! I am curious however, if there is a way to have the prompt be a single line prompt.
Basically, instead of current directory etc... being above if it could be on the same line as the arrow? Wouldn't even know where to start with customizing...
Cheers.

Duplicate issue #229: One line version
Created: 2016-09-05T00:18:35Z
Please, we like one line prompts.

Closing comment (2016-09-05T08:54:19Z): Duplicate of #228.
Repository: sindresorhus/pure

Issue #503: Display currently in use version of Node.js
Created: 2019-10-15T10:41:25Z
Feature request
Similar to the virtualenv feature, it'd be great if this was extended into node, and showed the current version being used via nvm or similar tools

Duplicate issue #528: [Feature Request] Show node version for JS-specific folders
Created: 2020-02-10T08:34:45Z
It would be great if we could also show the node version only for JS-specific folders that maybe contain a package.json or node_modules. When switching the working tree the information in the prompt should be updated accordingly. Here's an example of what I am imagining:

I have implemented this locally and would be willing to send my changes as a PR. However, I am not sure if it's the proper way of implementing it because I personally don't have that much experience with bash programming. But I'd love to get this in and get your feedback on my implementation. I was mostly inspired by how the git stuff is done asynchronously.

Closing comment (2020-02-13T08:17:07Z): Duplicate of #503
Repository: sindresorhus/pure

Issue #451: ⌘K to not clear 1st line of prompt - is it possible?
Created: 2018-12-03T09:22:59Z
When you hit ⌘K in iTerm (Edit › Clear Buffer), the 1st line of the prompt (that displays the current path) disappears, which is probably the expected behaviour, but I'd prefer it if it didn't disappear so that I can see the current path.
Is there a way to prevent that 1st line from disappearing on ⌘K?
Thanks!

To illustrate the question:

on ⌘K becomes:

Duplicate issue #452: path & git information get truncated after a CMD + K
Created: 2018-12-05T11:12:33Z
General information
Same issue as #329

Pure version: 1.x.x
ZSH version: 5.x.x
Terminal program & version: Hyper 2.0 & basic mac OS terminal
Operating system: macOs Mojave 10.14
ZSH framework: oh-my-zsh

I have:

 Tested with another terminal program and can reproduce the issue: 
 Followed the Integration instructions for my framework

Problem description
It's actualy the same issue as #329 but removing oh-my-zsh doesn't work on my end, I still get the directory path swallowed.
The prompt get truncated when cleaning terminal screen (CMD + k), the path & git information are invisible.
Reproduction steps

spam the terminal screen with commands or commands results
Hit CMD + k

My .zshrc:

I did not change anything from the installation
autoload -U promptinit; promptinit
prompt pure

Closing comment (2018-12-05T18:24:04Z): Duplicate of #451. It seems Hyper has changed the implementation of Cmd+K since #329, it is no longer synonymous with Ctrl+L, which is why it doesn't work.