I have A.php view file in
method registerJsFile is not found in a class
is there any specific reason to include the file manually rather than creating an asset bundle?
In any case if you've read the documentation regarding assets, you would have noticed that there's a clear distinction about source, published and external assets.
The most important part of it being that source and published assets use different options to determine whether and how a file should be published.
In your case you've got a source asset which needs to be copied over to the assets directory.
The invocation of
registerJsFile as hinted in the documentation, will expect a published asset.
Here you have specifically two options, which probably the first is more quick and coherent:
web/folder, as in
web/js/or whatever you prefer and keep using
Hope this clears things out.