How do I get rid of composer-asset-plugin in yii2 - yii2

Since the fxp\composer-asset-plugin broke last year, I am continuously experiencing problems installing yii2.
whenever I run a composer update command it fails due to this composer asset plugin. Everyday a new error pops up. I have read number of articles, github issues, with Sam and Alexander (maintainers of Yii Framework) continuously replying to the same problem then would close the topic. none of the updates to this plugin seem to be a fool-proof solution.
Now instead of asking how to solve the errors caused by this plugin (assuming that no one has a 100% working solution till date, only workarounds that work only 'sometimes'),
how do I get rid of this plugin and can't I manually install the packages through bower or npm?
In short, I mean,
In Yii 2.0, is life possible without this plugin, which has become a problem creator instead of solving problems.

You can use https://asset-packagist.org instead. Add this in composer.json:
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
Only problem is assets are installed in the different folder so you need to change the aliases. Add this in some common config file:
'aliases' => [
'#bower' => '#vendor/bower-asset',
'#npm' => '#vendor/npm-asset',
],

Related

Chrome Extensions: chrome.runtime.lastError: Internal error while updating dynamic rules

SOLUTION: Installed the latest version of chrome. All is well.
I am attempting to set dynamic rules to allow users to manually configure blocked and allowed sites using the declarativeNetRequest api. Specifically the updateDynamicRules method.
I attempt to add a new rule:
chrome.declarativeNetRequest.updateDynamicRules(
{
addRules: [
{
id: 1,
action: {type: "allow"},
condition: {urlFilter: "abc", resourceTypes: ["main_frame"]}
}
]
},
() => {
if (chrome.runtime.lastError)
console.log(chrome.runtime.lastError);
}
)
I've disabled all other extensions. I get the lastError: "Internal error while updating dynamic rules" I have attempted using another example here, but arrive to the same, rather vague result.
Has anyone else experienced this?
EDIT: Other things I have tried, in accordance to comments:
Changing the id of the dynamic rule in question
Uninstalling and reinstalling the extension
Thank you wOxxOm for the comment that helped solve my issue. "Might be a bug. Try Chrome Canary or the latest Chromium snapshot. To report the bug use crbug.com."
Simple installed the latest version of Chrome.

Chrome Web Store In-App Payments: Errors getting SKUs

I'm trying to get the SKUs available for a freemium Chrome Extension I'm developing.
I'm following all of the documentation here:
https://developer.chrome.com/webstore/payments-iap
...and I'm using the provided buy.js file, but it doesn't seem to work and the returned error messages are useless: "INVALID_RESPONSE_ERROR"
My code:
google.payments.inapp.getSkuDetails({
parameters: {env: 'prod'},
success: (r) => {
console.log(r);
},
failure: (err) => {
console.log(err);
},
});
Thoughts:
- Am I missing some permission in my manifest? I don't see any mention that it needs any additional ones.
Other StackOverflow questions have mentioned needing to proxy due to region issues. I'm in the states, shouldn't be an issue.
I've tried the above from both an options page and a popup - does it need to happen in a background page?
I'm pretty baffled. Any help is appreciated!
Thanks.
Updates:
The above works when released (in prod), but not locally
In prod you cannot buy your own thing (heads-up). It'll give you some stupid, meaningless error, but won't tell you that.
Still can't get this to work locally which means I have to test in prod.
If you need this to work locally, you must set the 'key' in your manifest.json file. When you reload it, it will show the same ID as the loaded extension from production.
Here are instructions on how to get the relevant key
If you debugging your extension in unpacked mode, you may need to set production "key" in your manifest.

Cake PHP 3 debug_kit panel

After install CakePHP3 ver. 3.6.2, debug_kit don't show panel. in the log file
"Warning: DebugKit is disabling itself as your host newtest.my is not in the known safe list of top-level-domains (localhost,dev,invalid,test,example,local). If you would like to force DebugKit on use the DebugKit.forceEnable Configure option."
How i can enable debug panel? Thank's!
This question has already been answered by Greg Schmidt but for clarity for anyone else wondering about this in the future: basically what is happening is CakePHP has determined that the host you are using is unsafe, and has therefore disabled the Debug Kit. CakePHP also provides a workaround for this by providing the DebugKit.forceEnable key to override this default behavior. It is recommended that you do this in either app.php or, if you have kept the default app.php as-is and provided an override file like app_local.php as you should, you can do it there as well:
'DebugKit' => [
'forceEnable' => true,
// other config options
]
CakePHP provides a tiny explanation of this in Their Cookbook
An other way to achieve this would be to do something like this in your bootstrap.php
if (Configure::read('debug')) {
Configure::write('DebugKit.forceEnable', TRUE);
Plugin::load('DebugKit', ['bootstrap' => TRUE]);
}

All of my .json files have problems loading reference/schema from schemastore.azurewebsites.net

I'm working in VS Code and started getting this error yesterday. All of my json files have this error, not just a few. If I remember right there was an update to the program yesterday or the day before. Did the update break something or reset a setting that I forgot I had set?
When looking this up, people are talking about downloading the schema and using it locally, but I would prefer not to have to do that and would instead like to find out why this broke?
I am using a proxy, but as far as I know that hasn't changed. Here's the exact error I'm getting.
Problems loading reference 'https://schemastore.azurewebsites.net/schemas/json/package.json': Unable to load schema from 'https://schemastore.azurewebsites.net/schemas/json/package.json': Unable to connect to https://schemastore.azurewebsites.net/schemas/json/package.json. Error: connect ECONNREFUSED 168.62.224.13:443
I'm behind my company's proxy which I don't know the details because it's everything automatic, and this problem have bug me for some time.
I'm not sure whether this is an universal solution but according to this issue, the http.proxySupport setting is defaulting to "override".
I turn this setting off and the errors disappeared:
"http.proxySupport": "off"
Open User settings of visual studio code through the command palette:
Press F1
Type user settings.
Select Preferences:Open User Settings from drop down
Put below code and modify accordingly:
"http.proxy": "http://username:password#hostname:port/",
"http.proxyAuthorization": null,
"http.proxyStrictSSL": true
Just close your VsCode Editor and open it again. That should fix the error.
I just turned off checkbox schema download and error gone.
Press F1 and follow open user settings/user/extentions/JSON
I was facing following issue with Angular 6:
Problems loading reference 'https://schemastore.azurewebsites.net/schemas/json/package.json': Unable to load schema from 'https://schemastore.azurewebsites.net/schemas/json/package.json': Unable to connect to https://schemastore.azurewebsites.net/schemas/json/package.json. Error: unable to get local issuer certificate
I added following properties at the end of the User Settings File and worked for me:
"http.proxy": "",
"http.proxyAuthorization": null,
"http.proxyStrictSSL": false
Add this to your setting.json. Your problem will be solved! Plus this works for me.
"json.schemas": [
{
"fileMatch": ["/package.json"],
"url": "https://json.schemastore.org/package",
"schema": true
}
]
Well i didnt like the idea to set "http.proxyStrictSSL": false, so i started searching, and i found this Issue on SchemaStore site from azure. After seeing this i concluded that my proxy was getting some problem with the certificate and authentication. What i did was change all "https" to "http" in the following session of package.json file(Mine was on this path: C:\Program Files\Microsoft VS Code\resources\app\extensions\typescript-basics\package.json).
"jsonValidation": [
{
"fileMatch": "tsconfig.json",
"url": "http://schemastore.azurewebsites.net/schemas/json/tsconfig.json"
},
{
"fileMatch": "tsconfig.json",
"url": "./schemas/tsconfig.schema.json"
},
{
"fileMatch": "tsconfig.*.json",
"url": "http://schemastore.azurewebsites.net/schemas/json/tsconfig.json"
},
{
"fileMatch": "tsconfig.*.json",
"url": "./schemas/tsconfig.schema.json"
},
{
"fileMatch": "typings.json",
"url": "http://schemastore.azurewebsites.net/schemas/json/typings.json"
}
]
I solved this issue by turning off proxy support in VS Code.
Open Settings and search for proxy support at the top. The only option shown should then be the one you want to switch from Override (which is the default) to off:
PS: You can also locate settings by pressing F1 and entering user settings.
please follow the step below to solve this problem:
Open the folder where package.json file present
Type npm install from cmd
restart VS code or any IDE that you use.
I tried every setting - the only one which works is adding this to settings.json:
"json.schemas": [
{
"fileMatch": [
"/package.json"
],
"url": "https://json.schemastore.org/package",
"schema": true
},
]
}
Note, using the HTTP URL doesn't work - it just ignores the URL.
If you still want the proxy support to work, just disable the proxyStrictSSL. Don't need to adjust other settings.
After banging my head against this for longer than I care to admit, I just needed to add the proxyAuthorization value for my Base64 encoded credentials, and did not need the proxy or proxyStrictSSL values.
I already had my proxy correctly configured in my environment variables. It only has the domain and port, not my credentials, ex. "HTTP_PROXY" "http://example.com:port/".
I used this C# code in LINQPad to get the proxyAuthorization value from my credentials:
var pw = "user#example.com:password";
var base64Encoded = Convert.ToBase64String(Encoding.UTF8.GetBytes(pw));
base64Encoded.Dump();
This is what I have in my user settings.json, using the encoded string from the above code dump.
"http.proxyAuthorization": "BASE64_ENCODED_VALUE"
Note: I believe that if I didn't need the full username with email address in the credentials for our proxy to let me out, I could have used an above solution. But since I did, this was the only way I could get it to work.
I`ve just delete this setting 😃
"http.proxy": "http://.......",
For me this works the Azure Storage Emulator stopped working ;-(
To start the Azure Storage Emulator:
Select the Start button or press the Windows key.
Begin typing Azure Storage Emulator.
Select the emulator from the list of displayed applications.
https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator
just do the 3
in CMD
AzureStorageEmulator.exe init
AzureStorageEmulator.exe start
AzureStorageEmulator.exe status
BAM all worked
It's issue of opening the vs code using command line or any type of terminal
for avoid this issue.
Just restart the vs code or close the vs code and open again
Add following code in setting.json file
"http.proxy": "",
"http.proxyStrictSSL": false
To Open setting.json file use the below step
Press F1
Type User Setting and then select Preferences:Open User Settings
Then click on Edit Setting.json link
for me turns out that the problem was due to terminal.integrated.shell.windows being deprecated in VSCode.
these are the steps i followed to fix it :
Open command palette (CTRL + Shift + P)
Search "Preferences: Open "User Settings" (the JSON file)"
find this field => terminal.integrated.shell.windows delete it and type this instead inside of "terminal.integrated.profiles.windows":
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
}
},```
if you want to disable PowerShell, just set its value to null

BabelHelpers is not defined using Polymer

I'm using Polymer and its build process. The bundled files are generated throughmy polymer.json file.
I'm not explicitely using Babel, I've just seen it's used by "paper-autocomplete".
When going to the website, I have a js error stating the BabelHelpers is not defined.
When I use MAJ+F5, it works !
When I use F5, it doesn't work
(BabelHelpers is not defined)
When running it locally it works fine. When I deploy it to my server, I face this issue.
I'm running it as a standalone Java application as it has a Spring backend.
The website as multiple entry points, it works fine for all other ones.
The stacktrace :
Command :
polymer build --js-minify --css-minify --html-minify
The polymer.json file
{
"entrypoint": "pt.html",
"builds": [{
"bundle": true,
"js": {"compile": true, "minify": true},
"css": {"minify": true},
"html": {"minify": false},
"addServiceWorker": true
}],
"shell": "resources/elements-platform.html",
"fragments": [
"resources/html/lazy-resources.html",
"resources/html/ym-dashboard.html",
"resources/html/ym-partners.html",
"resources/html/ym-favorite.html",
"resources/html/ym-agenda.html",
"resources/html/ym-todos.html",
"resources/html/ym-profile.html",
"resources/html/ym-messages.html",
"resources/html/shop-list.html",
"resources/html/shop-detail.html"
],
"sources": [
"resources/src/**/*",
"resources/css/**/*",
"resources/data/**/*",
"resources/images/**/*",
"resources/img/**/*",
"resources/js/*",
"resources/js/cal/*",
"resources/js/countdown/*",
"resources/bower.json"
],
"extraDependencies": [
"resources/bower_components/webcomponentsjs/webcomponents-lite.min.js"
]
}
I run into the same issue few days ago after I updated Polymer-cli to newest version. But in my case my application throwed same error on local virtual host (with self-sign certificate). On production website it was fine.
Actually, babelHelpers are injected into file that is selected as entrypoint inside your polymer.json file. Maybe try to look there, if you have correct existing file.
there are few existing issues on github with this problem. Unfortunately there is no verified answer (Polymer team does not really care about github issues)
https://github.com/Polymer/polymer-cli/issues/787
https://github.com/Polymer/polymer-cli/issues/765
There is also same question on stackoverflow with answer:
polymer-cli - getting "Can’t find variable: babelHelpers" when I set compile to true
I too am seeing 'babelHelpers' is undefined. In my case it's coming from redux.js:
q='object'==('undefined'===typeof self?'undefined':babelHelpers
.typeof(self))&&self&&self.Object===Object&&self,r=p||q||
Function('return this')(),s=r.Symbol,t=Object.prototype,
Babel helpers is also raised as in Issue #606, which says that it's resolved and closed. But it or something similar is back.
I made a few changes, but I don't know which one solved the issue. The problem came from paper-autocomplete. When I stopped using it I didn't have the issue anymore.
I'm still using it, but I made several changes :
I made sure I was using the generated service-worker
I stopped using the version of JQuery that was in my bower (3.2.1) and used it from JQuery CDN (2.3.1) as I've seen it caused issues sometimes
Added manifest.json in the polymer.json file