-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0.0-rc.6] Test files not transpiled #394
Comments
Thanks for the bug report! Does the "alternative usage" described in the README work for you? (have a single |
Same results with the alternative approach. Just the error is a bit different as different file is used. ℹ 「wdm」: Compiled successfully.
05 02 2019 01:26:14.122:INFO [karma-server]: Karma v4.0.0 server started at http://0.0.0.0:9876/
05 02 2019 01:26:14.124:INFO [launcher]: Launching browsers Firefox with concurrency unlimited
05 02 2019 01:26:14.129:INFO [launcher]: Starting browser Firefox
05 02 2019 01:26:15.734:INFO [Firefox 65.0.0 (Linux 0.0.0)]: Connected on socket yvLS_AvvRvYoEU88AAAA with id 24325332
Firefox 65.0.0 (Linux 0.0.0) ERROR
{
"message": "ReferenceError: require is not defined\nat /home/saurabh/DevEnv/SticyNotes/vuejs-template/src/test/main_test.js:1:7\n\n@/home/saurabh/DevEnv/SticyNotes/vuejs-template/src/test/main_test.js:1:7\n",
"str": "ReferenceError: require is not defined\nat /home/saurabh/DevEnv/SticyNotes/vuejs-template/src/test/main_test.js:1:7\n\n@/home/saurabh/DevEnv/SticyNotes/vuejs-template/src/test/main_test.js:1:7\n"
}
Firefox 65.0.0 (Linux 0.0.0): Executed 0 of 0 ERROR (0.565 secs / 0 secs)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. It seems that the file is not transpiled at all, it is passed on as is. Error is |
I think I'm getting the same issue, any updates? Or is there anything I can do to help diagnose the issue? |
I was having a similar issue where the console was reporting the following:
After about 4 days of playing around with config changes, I found that my issue stemmed from the use of splitChunks. I disabled splitChunks by setting it to undefined after importing webpack.config.js into my karma configuration and my issues went away:
|
Thanks for the reply, though that looks like a different issue from mine. I was getting the "unrecognised file type ts" bit. I did figure mine out though, the issue was I was requiring the config wrong, so none of the loaders were being applied. I don't have access to code right now but the fix was something like: |
@mipatterson @QXD-me It looks like your issue is related to #390 / #391. I shall fix that ASAP. |
Has this issue been fixed? i seem to have the same problem.
webpack.test..config.js
karma.conf.js
This results in the following error: It does not seem to recognize the arrow functions in my file, which leads me to believe that it is not transpiling it properly |
Is any one aware of issues with When I opened the browser in debug, the source did not include my test bundles. Disabling I am trying to find more information still. Has anyone else seen or hear of an issue like this with that package and karma-webpack? |
@SaurabhHarwande @mdblr Same issue for me on |
@liorbd saved the day! |
Closing this as it sounds like it is fixed in 4.0.2 and we are now on 5.0.0 |
I have setup a VueJS project with webpack. Test files are written in typescript. The project by itself work fine.
webpack --config config/webpack.config.dev.js
compiles the project successfully the ts files are transpiled to js.Now I have defined a karma.config.js as follows:
The webpack config is quite big. Here is the config for typescript:
running
karma start ./config/karma.config.js --single-run
gives the following error:The complete code is in this repository pasting all of it here would just make it difficult to read. https://gitlab.com/saurabh-harwande-repos/vuejs-template
The text was updated successfully, but these errors were encountered: