Closed ptomaszi closed 7 years ago
Additional issues found:
Error comments are in wrong places:
Wallaby fully supports the scenario you've described. You may try this simpler sample to see if it is working for you.
I thinks the issue is in the config (causing both of the issues you've listed - with compilation and with error comments).
the webpack "babel-loader" has been removed from its configuration
It doesn't look like the loader is present at all in the webpack config that you have included. There' s no babel-loader
in the rules that I can see.
Next, when you filter rules
var rules = webpackConfig.module.rules.filter(function (rule) {
return (rule.loader != "awesome-typescript-loader" || rule.use !== 'babel-loader?presets[]=es2015');
});
with this condition, none of the loaders will be filtered out. You need to replace ||
with &&
.
The only reason I try to use the wallaby babel compiler is that when I use the webpack one, error messages for the spec files do not show in correct places in the Visual Studio.
I'd still recommend using wallaby babel compiler for performance reasons, however you may use the webpack babel-loader
, just need to use the correct source maps option as described in this docs section. I don't think it is an issue though, because as I pointed put, in your case there's no babel-loader
at all in the current config.
Could you please share a sample GitHub repo project where I could reproduce the issue? No real code/tests is required, just the setup (webpack config, package.json, babelrc, tsconfig, etc), that ES6 file (even with just an empty export export const welcomeComponent = {}
) and a test file importing the file. Once you publish the repo, I'll jump in and send you a pull request with a working config.
I have created a sample project which can reproduce an error. The project can be found here:
https://github.com/ptomaszi/wallaby_webpack
In addition to the "class" error I also see "Missing tracer start subscription" error.
Please let me as soon as you can, what is the issue, so I can progress with my project.
Thanks, however I was hoping you create a sample project closer to your setup rather than taking our sample project (because that would be the fastest way for you to apply changes in your real project), but anyway - whatever works best for you.
I created the pull request to make it work.
the "class" error
You didn't have any babel config and babel by default does nothing, so I added the required preset and the .babelrc
file.
I also see "Missing tracer start subscription" error.
This is because you didn't set load: false
to files and tests as described here in the docs.
Also fixed a couple more smaller issues in the config.
Hope it helps.
Thanks for your help. It works now!
Awesome, thanks for the update!
Issue description or question
Wallabyjs fails to use the babel compiler for any ES6 JavaScript files. It is used in a connection with the webpack and the webpack "babel-loader" has been removed from its configuration. I am getting the following error: SyntaxError: Use of reserved word 'class'
Wallaby.js configuration file
webpack configuration file
ES6 file where it errors:
The only reason I try to use the wallaby babel compiler is that when I use the webpack one, error messages for the spec files do not show in correct places in the Visual Studio.