I try to use last version of LogSymbol, that provides a breaking change due to esm compatibility.
But using Gherkin-testcafe and then testcafe, it seem compilation failed due to no esm support.
I don't why I get this error from testcafe:
1
if I try to override testcafe typescript compilation options but I get this error:
2
A sample of project with my issue is avalaible here: https://github.com/bbutel/testcafe-logSymbol-issues
TestCafe cannot work with pure ESM modules like logSymbols because built-in TestCafe compilers transpile all test code to the commonjs format, which in not supported by the latest version of logSymbols. Thus, to solve the issue, you need to use the commonjs version of the logSymbols module.
Related
I am using Vue CLI to create a Vue 2.0 project and one of the options is using Babel. I understand Babel is a transpiler but what exactly does it do? I created a project with it and another without it and I don't see the difference so what exactly is the pro/con of it ? I can't see offhand what it is doing.
You are correct. Babel is a transpiler. It transpiles your JavaScript code to one or more taget browsers, that does not support the lastest fetures. You will not see any difference, if using a newer browser.
Babal usually only makes sense if you need to support older browsers, like IE 11 or browsers from before 2017.
I have updated my Angular CLI, with version 10.0.5 (globally and locally both) And while I am trying to build my angular project by below command-
ng build
I am getting below error-
Schema validation failed with the following errors: Data path ""
should NOT have additional properties(es5BrowserSupport).
While I explored this error I found that-
#angular/cli required minimum version 7.3 &
#angular-devkit/build-angular required minimum version 0.13
But I think I have the updated versions because I re-checked and it was showing I already have the updated versions of both the packages.
FYI..I can't comment this option (es5BrowserSupport : true) in Angular.json, I want to keep this because if I comment this option it's giving other issues.
Now I am not understanding what I am doing wrong here. Can anyone suggest some way to resolve this? Because currently I am unable to run my project because of this issue.
FYI, my old Angular CLI version was-
#angular/cli": "^8.3.20"
The property es5BrowserSupport was deprecated and has been removed.
The inclusion for ES5 polyfills will be determined from the browsers listed in the browserslist configuration.
BREAKING CHANGE
Deprecated browser builder option es5BrowserSupport has been removed. The inclusion for ES5 polyfills will be determined from the browsers listed in the browserslist configuration.
https://github.com/angular/angular-cli/pull/17484
I'm writing an aurelia application with aurelia-fetch-client library.
When I try to post an object to my api service I get the error:
TypeMismatchError
In console only from Edge. Other browsers (Chrome, Firefox and IE11) have no problems. There are no description or any other details about it.
In all but the newest versions of Edge you need to include the fetch polyfill in order for aurelia-fetch-client to work. I think it's supported since version 14 but I wouldn't necessarily rely on it. Edge is known to be quirky with some of these things (the Promise implementation is also horribly slow, which is why I personally always use bluebird)
You can install it with npm i whatwg-fetch --save and make sure to import it + include it in your bundle config (the instructions for this depend on which build system you're using)
If you follow JetBrains' Getting Started with Node.js in WebStorm instructions, node-express specific code is highlighted correctly. However if you create your own simple node-express project, e.g. using node-express' Guide, then express specific functions such as app.get() are underlined and marked with the following warning:
Unresolved function or method get()
This happens even if you enable the following libraries under Settings\JavaScript\Libraries:
Node.js Globals
Node.js v0.10.31 Core Modules
express-DefinitelyTyped (which you need to download)
How can I configure WebStorm to resolve node-express functions such as app.get()?
Instead of express definitelyTyped, use express types in your project:
npm install --save-dev #types/express
Alternatively, for yarn users:
yarn add --dev #types/express
This worked great for me.
TL;DR:
you go to Settings/Preferences --> Languages and Frameworks --> JavaScript --> Libraries, click the Download button on the right, then select "express" (or any other library you need) and click Download and Install.
Enabling express-DefinitelyTyped typescript library for Express project does work for me - app.get() is successfully resolved. Adding typescript stubs is the only possible workaround, as WebStorm can't understand the way express is defined - see https://youtrack.jetbrains.com/issue/WEB-6667#comment=27-470393
If adding typescript stubs doesn't work for you, please try invalidating caches. If this doesn't help, I'd suggest contacting jetbrains support, providing a sample project
Could you use npm modules by using require() in phantomJS? It seems to be able to load javascript files so maybe this is possible?
That is entirely depends on the nodejs module. It won't work if nodejs module requires some support via native function interface.(npm modules like http, socket.io, will not work on phantomjs, because it dependents on native interfaces)
Pure JavaScript nodejs modules should work on phantomjs too.
fyi, phantomjs has an aproximation of commonjs.
you can not use amd modules in phantomjs, and I do not know of any amd loader (like requirejs) that works in phantomjs
Update (2015): I have been using commonjs modules in PhantomJs 1.x and 2.x, they work well with one caveat: you can not use source-mapping (at the bottom of the file, looks like //# sourceMappingURL=index.js.map) as it will cause the PhantomJs module loader to fail. Otherwise, commonjs modules will load normally.