-
Notifications
You must be signed in to change notification settings - Fork 156
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
TypeError: Cannot read property 'lang' of null #16
Comments
Hi, thanks for the bug report I downloaded the webpack repo and failed to reproduce the issue. Would you be able to post the test file and component where you're getting this error, or even better post a reproduction repo? |
I ran into this issue as well. I resolved it by changing the function process.js to:
I can make a pull request with this change or you might want to handle it a different way. |
I would appreciate a PR, and ideally a unit test with a case that fails. Thanks 🙂 |
Cool, should have something today or tomorrow. I think this issue popped up because I was using functional SFC with no script section (just a template). |
Looks like this will handle the issue I ran into: Any idea when a new release will go out? Thanks! |
I've just released in 1.0.0 vue-jest. Note I've changed the package name to vue-jest. You can still download jest-vue, but it won't be receiving further updates. To install the new version:
I made a request to the original owner of vue-jest to transfer ownership to this repository so that the package name could be more idiomatic to other preprocessors like babel-vue and ts-vue. |
@mikemenaker @chlab I confirm that SFC with no script section do work with version 1.0.0 vue-jest But you need to define the template as |
There was another problem when testing nested functional components with mount. This pull request solves the issue: |
@eddyerburgh sorry for the late reply. This is the repo that I'm encountering these problems. It has one unit test. I'm no longer seeing the Do you mind having a quick look? Can you run Thanks! |
I am having the same problem here :(, the lang one. |
@icaioincau is this fixed for you in 1.0.1? If not, can you post the error? |
Oh! I had oversimplified the parsing of the funcional templates and had forgotten some cases like passing a function or an array as props. I just updated the pull request and I hope that this solves most of the common issues but more edge cases should arise so I'll keep an eye on this. @eddyerburgh Sorry for the inconvenience, could you run a new release and test it with some complex functional templates please? |
I've released the changes in 1.0.2 |
Cool! I have a project with different funcional components and it works. Let's see if we find new edge cases. Thanks for the release! |
Hi @eddyerburgh my components is this:
He is on a main component that has a script.
The error:
Version used: 1.0.2 |
@icaioincau Try again changing your template to |
It worked :D |
Hi! I've still got error with 'lang' in 1.0.2 version. Any way to fix it without adding functional to template? |
@Ca4tkin can you post the SFC that you're getting the error with? |
@eddyerburgh, here it is:
|
Thanks for posting the component @Ca4tkin 😀 I've pushed a fix in 1.0.3 |
Thanks @eddyerburgh 1.0.3 fixed the issue in my projects. |
@eddyerburgh thanks! It's fixed |
I am trying out your webpack template to use jest for unit testing in a new little app and am getting this error when running
npm run unit
:I reduced the file to an absolute minimum and I'm still getting the error.
App.spec.js
App.vue
package.json
This is the offending line in
jest-vue/lib/process.js
:Which seems to make sense since I do not define a
lang
attribute on my script tags.The text was updated successfully, but these errors were encountered: