export default is missing
See original GitHub issueVersion
1.0.0-beta.31
Reproduction link
https://jsfiddle.net/q7d08jwy/
Steps to reproduce
switch any import statement of the test utils from:
import * as utils from "@vue/test-utils";
to:
import utils from "@vue/test-utils";
What is expected?
testUtils should contain all the exports like it did in v1.0.0-beta-28 so you can do import testUtils from “@vue/test-utils”; testUtils.mount(…)
What is actually happening?
testUtils is undefined
I think we shouldn’t restrict options.
The changes where introduced in this commit: https://github.com/vuejs/vue-test-utils/commit/d45e248ea9d0b9665ba19a020483db493219b481
This is definetly a breaking change and should be documented in the release notes if intended!
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Export default was not found - Stack Overflow
That's because you didn't export the thing you wanted to export in your module, or you're using a different name for it. When...
Read more >Javascript - Export default was not found - Laracasts
Hi, using this line import translateDate from '@/utils/date-translation' you basically tell JS to import the default exported object from the file and use...
Read more >Solved - Export 'x' (imported as 'y') was not found in the ...
The "import not found" error occurs when we perform a named and/or a default import from a file that doesn't have a named...
Read more >Error: CSF: missing default export #16598 - GitHub
Writing stories in separate files and re-exporting them from a single file yields the error: Error: CSF: missing default export To Reproduce ...
Read more >WARN export 'default' (imported as 'content') was not found
WARN export 'default' (imported as 'content') was not found ... So basically it is related to mini-css-extract-plugin, we have used it to extract...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I think the above points are compelling enough to not add this. Sorry for the inconvenience @adrianjost - we should have documented this more clearly in our release notes.
Since there is a pretty simple fix available, I’m going to close this issue.
I totally understand that this software is still in beta and changes may happen. I was just wondering because I had found this issue: https://github.com/vuejs/vue-test-utils/issues/873 where it was implicitly implemented and it was in the docs a couple of versions earlier. I am 100% fine leaving it as is now because of the easy fix.
FYI: I tried implementing export default again and this simple (but ugly duplicate) code seem to work fine (
yarn test:unit:only:dev
andyarn build
are working without any problem). I have had some problems with flow (which I never used before) when putting the object into a variable thats why the code is that ugly. But it does work.I did the adjustments in this file